Announcement Announcement Module
Collapse
No announcement yet.
Error display with Spring MVC Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error display with Spring MVC

    I'm aware that if you use validators you can display an error back to your page using spring:hasBindErrors.

    Is there something for displaying errors back to the user that you can encounter in your controller, or do you add an error attribute to your command object and check for it ?

  • #2
    Also how can i tie the messages to something in a .properites file.

    Comment


    • #3
      the following might help you...

      http://www.salixalba.uklinux.net/wil...ng/spring.html
      Code:
      <spring:hasBindErrors name="commandBean">
               <p>There were ${errors.errorCount} error(s) in total:</p>
               <ul>
                  <c:forEach var="errMsgObj" items="${errors.allErrors}">
                     <li>
                        <spring:message code="${errMsgObj.code}" text="${errMsgObj.defaultMessage}"/>
                     </li>
                  </c:forEach>
               </ul>
            </spring:hasBindErrors>

      Comment

      Working...
      X