<@s.textfield name="user.userName"
               label="%{getText('user.userName')}"/>

should work, but, yes, this is an area where the Struts 2 tags are
still strangely verbose.

Feel free to file a feature request for concise alternative syntax.

To lookup mesages resources in the S2 validation, we use the attribute
"key". So, I would suggest something like

<@s.textfield key="user.userName"/>

to grab the label from the message resources and the name/value from
the user object.

<@s.textfield label_key="userName"  name="user.userName"   />

(Of course, this isn't a FreeMarker issue per se. All the Struts Tags
renditions work the same way.)

-- HTH, Ted.
* http://www.husted.com/struts/


On 9/23/06, David H. DeWolf <[EMAIL PROTECTED]> wrote:
I'm finding that I use something similar to this very often:

<@s.textfield name="user.userName"
               value="%{user.userName}"
               label="%{getText('user.userName')}"/>

Is anyone aware of a shortcut so that I can eliminate the redundancy?
It would be nice if there was something like:

     <@s.textfield property="user.userName"/>

that would accomplish a similar thing.  Anyone else running into this
inefficiency?

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to