aspose file tools*
The moose likes Struts and the fly likes How to use <s:if> tag in another Struts2 tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to use <s:if> tag in another Struts2 tag" Watch "How to use <s:if> tag in another Struts2 tag" New topic
Author

How to use <s:if> tag in another Struts2 tag

Vamshi Jampala
Ranch Hand

Joined: Feb 23, 2008
Posts: 40
I know may be a stupid question but still, can we use s:if tag in another struts2 tag ?

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

No; that's malformed JSP.

You can either inline an OGNL expression in the "value" attribute, set a value and use it, or do things like that in the action and expose only a properly-filled action property (preferred).
Vamshi Jampala
Ranch Hand

Joined: Feb 23, 2008
Posts: 40
I know how to do it in action class, could you please explain me as in how to do it in OGNL.Thanks for your time David
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Use OGNL's ternary expression.
 
wood burning stoves
 
subject: How to use <s:if> tag in another Struts2 tag
 
Similar Threads
How To Use Servlet Instead Of Jsp In Struts2
Problem using <s:if tag of Struts2
Struts2 newbee - Problem when using form tag
Iterating a Array in Struts2
Struts2 test condition in s:if not working