Results 1 to 2 of 2

Thread: About spring bind

  1. #1
    Join Date
    Apr 2008
    Posts
    1

    Default 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. #2
    Join Date
    Jan 2008
    Posts
    29

    Talking

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

Posting Permissions

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