Announcement Announcement Module
Collapse
No announcement yet.
problem in displaying error messages on validation failure Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • problem in displaying error messages on validation failure

    hi
    i have a registration form on landing page of website.i implement a formcontroller & validator.whenever validations are failed appropriate error message should be displayed.otherwise next view should be displayed.But error messages are not displayed though they are displayed on loggers.
    i think i should associate a failure viw also.but i don't know how to do it
    plz help

  • #2
    where are you running your validators?
    If you are running them as exit-actions for your view, you will get the behaviour you describe. Put them inside the transition element to get the correct behaviour.
    Code:
    <transition...>
      <action ... bindAndValidate.../>
    </transition>
    To display errormessages in the jsp, you have to use something like this:
    Code:
    <form:errors path="*"/>

    Comment


    • #3
      validation failure

      hi! thanks for reply
      i put validators and controllers in src/web and all jsp's in WEB-INF/views/tiles.
      my application is a online registration process consisting of various steps.i use ajax to display all the layers.whenever there is error on any layer execution is halted & corresponding error mesages get displayed.it is working fine for all the layers except the first layer.
      my code is like :
      <spring:bind path="command.mobileNumber">
      <input id="mobileNumber" type="text" name="mobileNumber"
      value="<c:out value="${status.value}"/>" />
      <span class="error"><c:out value="${status.errorMessage}"/></span>
      </spring:bind>

      Comment


      • #4
        It might be the name of the input element.. Try to use ${status.expression} as the name of the input element..
        How is the definition of the view-state for this page?

        Comment


        • #5
          error message problem solved

          Thanks , for reply
          My error message problem is solved. My code was alright ,the problem was that i was not handling the response coming from controller.Response was proper it had error messages included also ,but it was requiring a view to display that message.As my landing page view was coming from the formController that was processing the input data coming from view i.e. Mobile Number & Email Address.This formcontroller was associated with Validator.
          To rectify the problem, I made one IndexController that displays the landing page of website.And made one more view that contains only registration div.Then associate this view with my previous formController.set IndexController as main url in servlet.xml.

          Comment

          Working...
          X