Announcement Announcement Module
Collapse
No announcement yet.
Problem with ${status.errorMessage} in spring 1.1.3 ? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem with ${status.errorMessage} in spring 1.1.3 ?

    Hi,

    I'm quite new to spring and I've tried to make a logon application. To do this, I used some code of this article : http://www.devx.com/Java/Article/22134

    But I have a problem with ${status.errorMessage} in my jsp file :

    Code:
    <spring&#58;hasBindErrors name="credentials">
    <font color="red">
    <core&#58;out value="$&#123;status.errorMessage&#125;"/>
    </font>
    </spring&#58;hasBindErrors>
    The ${status.errorMessage} is always blank. After quite some time, I managed to figure out what was the problem. If I use the spring.jar and spring.tld of the zip file of the article, my code works fine. But If I try the 1.1.3 or 1.1.4 version of the those files (I haven't tested all the versions) it doesn't work: the ${status.errorMessage} is blank.

    So I was wondering if It was a bug, or if I did it wrong. Perhaps, there is a new way of doing all the validation stuff.

    Thanks, and forgive me my english

  • #2
    Please have a look the documentation for the spring tags:
    http://www.springframework.org/docs/taglib/index.html

    The status.errorMessage is only available for the <spring:bind> tag. When using <spring:hasBindErrors> you should use other tags, such as:

    errors.errorCount: the number of errors
    errors.allErrors: all errors in a java.util.List
    errors.globalErrorCount: the amount of errors registered for the object (so not for properties)
    errors.globalErrors: the errors registerd for the object, in a java.util.List
    errors.globalError: the first, non-field-specific error

    Hope this helps,
    Arjan Huijzer

    Comment


    • #3
      Ok, thanks, I've tried with <spring:bind> tag, and it works.

      Comment

      Working...
      X