aspose file tools*
The moose likes Struts and the fly likes Unable to use one struts2 tag inside another Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Unable to use one struts2 tag inside another" Watch "Unable to use one struts2 tag inside another" New topic
Author

Unable to use one struts2 tag inside another

Abhilash Chander
Ranch Hand

Joined: Oct 18, 2009
Posts: 39
Hi All,

I have a struts 2 select element to select the mumber of results to be diplayed per page. I set the selected value in a session variable. On the JSP page I want the user selected value to be pre-selected in the select element. If I hard cord the value it works like this



But if I use value from session using the <s:property> tag it doesn't work



Please help how can I work this out. And secondly, It is always so confusing when it comes to using one struts2 tag inside another. Can somebody provide the sysntax how to use one struts2 tag inside another.

Thanks in advance.
Richard Golebiowski
Ranch Hand

Joined: May 05, 2010
Posts: 213

Try the following, using OGNL:

Abhilash Chander
Ranch Hand

Joined: Oct 18, 2009
Posts: 39
Richard Golebiowski wrote:Try the following, using OGNL:



Richard that worked like a charm. Thanks for your help.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

(Just as a side note, you can't use *any* JSP tag inside another--that's not valid JSP.)
 
Consider Paul's rocket mass heater.
 
subject: Unable to use one struts2 tag inside another