This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to use one struts2 tag inside another

 
Abhilash Chander
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 213
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try the following, using OGNL:

 
Abhilash Chander
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Richard Golebiowski wrote:Try the following, using OGNL:



Richard that worked like a charm. Thanks for your help.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(Just as a side note, you can't use *any* JSP tag inside another--that's not valid JSP.)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic