Announcement Announcement Module
Collapse
No announcement yet.
<form:form> Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • <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
    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.

    Comment


    • #3
      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.

      Comment

      Working...
      X