Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem in logic:Iterate

 
Mike Jeya
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a arraylist of Objects(JavaBen with get,set methods).I placed in ActionClass's request

I am trying to acesss the values of javaBEan in the forwarded JSP pages

Here the BeanList is a ArrayList Object..
phaseName is the variable in JavaBean..

<logic:iterate name="BeanList" scope="request" id="obj">
<table><tr>
<td><bean:write name="obj" property="phaseName"/></td>
</tr>
</table>
</logic:iterate>

but the error says
javax.servlet.ServletException: Cannot find bean BeanList in scope request

Can anyone tell me what mistake am I doing
[ September 13, 2004: Message edited by: Mike Jeya ]
 
sreenath reddy
Ranch Hand
Posts: 415
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Check out whether that arraylist is properly set r not.try to check that before using that tag .its null thats why its showing that exception
 
Sheldon Fernandes
Ranch Hand
Posts: 157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the key you have used when setting the list of beans in request? You might have done something like this:
request.setAttribute("aKey", aBeanList);

Use the same key (for example "aKey") in the name attribute of the <logic:iterate> tag.
In other words, verify if "BeanList" is the key.
 
Mike Jeya
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank u guys..

I solved that problem..

I haven't mentioned the scope as request in action path (struts-config.xml)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic