File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes nested struts tags Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "nested struts tags" Watch "nested struts tags" New topic
Author

nested struts tags

Sree Jag
Ranch Hand

Joined: Oct 14, 2003
Posts: 77
Hi all,
Can we use nested tags in Struts?
For example, i have a drop down menu. the current value of that dropdown comes from a property of a value object which is an element of a collection of custom value objects.
here's the code for that:
<logic:iterate id="testInfo" name="applicantForm" property="applicantTestInfo">

<html:select property="testId">
<html ption value="<bean:write name="testInfo"
property="testTypeId"/>"/>

<html ptions collection="testCodes" property="key" labelProperty="value"/>
</html:select>
</logic:iterate>
In the above snippet, i am not able to use the nested <bean:write tag in the html ption value tag.
Can anyone suggest how to use nested tags?
Thanks in advance,
Seshu


Sree Jag<br />SCJP 1.4
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4447
    
    5

No, you can't nest tags that way; and that's not a Struts limitation, it's true for JSP tags in general. This question has come up a number of times before. Please do a search in this forum or in the JSP forum for suggestions on how to get around this (search for "nested tags") .


Junilu - [How to Ask Questions] [How to Answer Questions]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: nested struts tags
 
Similar Threads
html:option woes
prepopulating html forms
using c:out in a href and html:select
Datasources Problem-Servlet action is not available
How to use html:options