This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes ITERATE TAG-ISSUES 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 "ITERATE TAG-ISSUES" Watch "ITERATE TAG-ISSUES" New topic
Author

ITERATE TAG-ISSUES

KRISH DOSS
Greenhorn

Joined: Feb 16, 2002
Posts: 19
Hi All,
I am facing lot of issues in <html:iterate>
tag.I try to populate collection values as
label for radio buttons. Here is the code.

<table>
<logic:iterate id="mapID" name="utilMap" property="salutationMap" scope="session">
<tr>
<td>
<html:radio property="mapProp" value='<bean:write name="mapID" property="key"/>' />
<bean:write name="mapID" property="value"/>
</td>
<tr>
</logic:iterate>
</table>
I set the 'utilMap' Object ,which
contains getSalutationMap(), in session.
But i am getting following error.
javax.servlet.jsp.JspException: Cannot find bean under name org.apache.struts.taglib.html.BEAN
at org.apache.struts.taglib.html.RadioTag.doStartTag(RadioTag.java:189)
Can you explain me what went wrong?.
1. Is it required for a class ,referred in
iterate tag, to be set in request/session?.
2. Should i need to make any additions in
ApplicationResources.properties file?
Your guidance is highly appreciated.
thanks
krishna
KRISH DOSS
Greenhorn

Joined: Feb 16, 2002
Posts: 19
Problem Fixed.
krishna
saravanan balu
Ranch Hand

Joined: May 19, 2000
Posts: 49
Hi Krishna,
Could you tell us what was wrong and how did u solve the problem? this could be helpful for others who are having the same problem.
thanks
Marek Lapin
Greenhorn

Joined: Sep 19, 2004
Posts: 15
Hi

you cannot referenct bean value this way...

<html:radio property="mapProp" value='<bean:write name="mapID" property="key"/>' />

if you want to put a dynamic value there , then you have to use jsp scriplet (or what it is) like this

<html:radio property="mapProp" value='<%= (mapID class name)mapID.getKey() %>' />

atleast i coudnt find any other way to solve these problem...
In this cases it realy is better to use som of these JSTL stuff..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ITERATE TAG-ISSUES
 
Similar Threads
How do I iterate the object which is in Session (in a JSP)?
logic:iterate
html Checkbox value not getting
HTML:OPTIONS
VALUE Property of RADIO-RENDERING ISSUE