Announcement Announcement Module
Collapse
No announcement yet.
A simple check for form errors in JSP page? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • A simple check for form errors in JSP page?

    Hello

    I need, what seem to me, a very simple check in a JSP-page to see if there are any errors at all that I have added, after submit. It could look something like this:

    <c:if test="${command.errors}">
    My html code...
    </c:if>

    (where "command" would be my form). I havn't been able to find an example of how to check this in a page. I'm looking for the same Java function as "errors.hasErrors()". I'm not looking to print them in the page, at this point, just determine if errors exist so I can write different HTML.

    Thanks

  • #2
    i think that the tag you are looking for is:
    <spring:hasBindErrors name="${form}">
    </spring:hasBindErrors>

    it exposes the errors in the "errors" variable

    Comment


    • #3
      Almost!

      Thanks, this is almost what I want, it's just that I also need cases when there are no errors. Can this tab be written in its opposite as well?

      Comment


      • #4
        Hi

        Can anyone provide code for a window where i can check the errors of any jsp code.....i am in desperate need of it.....

        Comment

        Working...
        X