Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
D kukreja
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic