Announcement Announcement Module
No announcement yet.
Facing Issue in displaying error Message in JSP using Webflow 2 Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Facing Issue in displaying error Message in JSP using Webflow 2

    Hi Everyone,

    I am facing an issue in displaying error message on JSP page by using Webflow 2. Need some suggestion or guideline on this.
    Q: Is it possible to display error message on JSP page which is created in validator class?

    In my requirement on a JSP page if I enter wrong value on a text field it should display error after I press submit button.

    I have created a validator class and I am using it as a model in a view-state. If I enter a wrong value in a JSP page it is able to call validator class and is not allowing the jsp page to move to next page until I enter correct value.
    In validator class I am using addMessage() method of MessageContext class
    messages.addMessage(new MessageBuilder().error().source("emplID").defaultText("EmplID is incorrect..").build());
    In JSP page I am using hasBindErrors tag to display error:
    <spring:hasBindErrors name="aaaValidate">
    				<label>This is error ${error.defaultMessage}</label>

    My requirement is to display error message which I am creating in a validator class by using addMessage() method.

    Thanks in advance..
    Last edited by debo; Jun 2nd, 2009, 03:42 PM.

  • #2
    Try this in your jsp:

    <%@ taglib prefix="form" uri="" %>
    <form:errors path="yourBean.emplID" cssClass="errors" />
    Or without 'yourBean'.

    A good tutorial: