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

  • form tags vs spring:bind

    Hi all!

    Could somebody hint me how for example tag
    <form:input path="command.prop"/>
    can be written in terms of spring:bind?
    I suppose it can be
    <spring:bind path="command.prop"><input type="text" name="${status.expression}" value="${status.value}"></spring:bind>
    , but I am not sure this is the same.
    If I am right: can
    <spring:bind path="command.prop"><input type="text" name="${status.expression}""></spring:bind> (without value)
    be used as one-directional bind (to server).

    Thanks.

  • #2
    Originally posted by buzzer View Post
    Could somebody hint me how for example tag
    <form:input path="command.prop"/>
    can be written in terms of spring:bind?
    I suppose it can be
    <spring:bind path="command.prop"><input type="text" name="${status.expression}" value="${status.value}"></spring:bind>
    , but I am not sure this is the same.
    It's nearly the same, only form:input also renders the id attribute (but this has no relevance in your case). You can easily check this for yourself when your look at the sourcecode of the generated html page.

    Originally posted by buzzer View Post
    If I am right: can
    <spring:bind path="command.prop"><input type="text" name="${status.expression}""></spring:bind> (without value)
    be used as one-directional bind (to server).
    If I understand you correctly, you don't want to display the current value, but just want to receive the input. In this case you are right.

    Or you could simply write:
    Code:
    <input type="text" name="prop">
    when prop is the name of your field in command.

    Martin

    Comment

    Working...
    X