Announcement Announcement Module
Collapse
No announcement yet.
About spring bind Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • About spring bind

    Hi all,

    I've got a problem on show error messages on jsp using spring:bind.
    The problem caused by there are more than one same name things on the same page, for example:
    Code:
    <form ...>
    
    <spring:bind path="command.userid">
    <input type='text' name='${status.expression}' value='1'>"><c:out value="${status.errorMessage}"/>
    </spring:bind>
    <spring:bind path="command.username">
    <input type='text' name='${status.expression}' value='name1'><c:out value="${status.errorMessage}"/>
    </spring:bind>
    
    <spring:bind path="command.userid">
    <input type='text' name='${status.expression}' value='2'>"><c:out value="${status.errorMessage}"/>
    </spring:bind>
    <spring:bind path="command.username">
    <input type='text' name='${status.expression}' value='name2'><c:out value="${status.errorMessage}"/>
    </spring:bind>
    <input type="submit" value="submit">
    </form>
    when the user leave the first "username" with blank, both the 2 "username" got the same errorr.
    So anyone who can give me a solution how to show error on which has got error?

  • #2
    what you are exatly trying is assiging two values for a single variable.. This is never possible .. change your logic

    Comment

    Working...
    X