Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) 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.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!