Results 1 to 3 of 3

Thread: <form:form>

  1. #1
    Join Date
    Apr 2008
    Location
    Surabaya
    Posts
    8

    Default <form:form>

    Can we get the error count inside this tag? or a sign if there is an error besides the error message itself? Thanks.

  2. #2
    Join Date
    Apr 2008
    Posts
    5

    Default

    I have exactly this question. I tried this:

    Code:
    <form:form commandName="myCommand">
    	<spring:bind path="myCommand">
    		<c:if test="${status.error}">
    			One or more fields in your submission contained errors.
    		</c:if>
    	</spring:bind>
    ...
    Despite the fact that there were error codes coming in of the form *.myCommand.* that were picked up fine by the <form:errors> tag, my general message didn't display.

    Obviously, using <form:errors path="*"> isn't good because I don't want a list of field errors, I just want a general message.

  3. #3
    Join Date
    Apr 2008
    Posts
    5

    Default

    Ah, I just figured this out by looking at a different thread. This is one thing you can do:

    Code:
    <form:errors path="*">
      Your general error message.
    </form:errors>
    This will only display "Your general error message." and won't display the field errors.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •