This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Struts and the fly likes nesting tags and evaluate expressions in Struts2.0 ,alternative to bean:define ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "nesting tags and evaluate expressions in Struts2.0 ,alternative to bean:define ?" Watch "nesting tags and evaluate expressions in Struts2.0 ,alternative to bean:define ?" New topic
Author

nesting tags and evaluate expressions in Struts2.0 ,alternative to bean:define ?

D kukreja
Ranch Hand

Joined: Jan 29, 2008
Posts: 39
I have a custom tag library in struts 2.0 and I want to pass a value from the action . I can get the value with <s roperty value="xyz"/> tag. But I cannor pass it to my custom tag like <custom:custom size='<s roperty value="xyz"/>'/> this doesn't work.
I tried using <s:set name="temp" value="1"/> then passing to the custom tag <custom:custom size="#temp"/> I tried all combinations of #temp , #{temp} and #{'temp'}.
This was so easy with <bean efine> in struts 1. Is there any alternative in struts 2.0
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
First of all, make sure that your TLD is defined to accept runtime expressions for that parameter.

Secondly, your custom taglib has probably not been defined to accept OGNL expressions. Therefore, you should use an EL expression instead.


Merrill
Consultant, Sima Solutions
 
GeeCON Prague 2014
 
subject: nesting tags and evaluate expressions in Struts2.0 ,alternative to bean:define ?