struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David H. DeWolf" <ddew...@apache.org>
Subject Re: [s2] Freemarker Shortcuts
Date Wed, 27 Sep 2006 12:13:12 GMT
Thanks Ted.  I'll file an issue and supply a patch later today.

David

Ted Husted wrote:
>> <@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 <ddewolf@apache.org> 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: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message