aspose file tools*
The moose likes JSP and the fly likes How  do I iterate the object which is in Session (in a JSP)? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "How  do I iterate the object which is in Session (in a JSP)?" Watch "How  do I iterate the object which is in Session (in a JSP)?" New topic
Author

How do I iterate the object which is in Session (in a JSP)?

Mike Jeya
Ranch Hand

Joined: Apr 15, 2004
Posts: 54
Hi
I have a Arraylist.it has some set of object
I am setting this object in Servlet ,and placing into session.
Then ,I am forwarding to a JSP.

How do I iterate the values in JSP with minimal scriptlets

I hope any ranch guys can help me..Please bear my ignorance..

[ November 28, 2004: Message edited by: Mike Jeya ]
[ November 28, 2004: Message edited by: Mike Jeya ]
Rashid Darvesh
Ranch Hand

Joined: Feb 13, 2004
Posts: 189
here is the code i have to iterate over an array of product bean. The array was set to a session object with the name as RR

<logic:iterate id="product" name="RR" scope="request" type="com.nilgiri.crs.customerResearch.Model.Product">
<tr>
<td>productID = <bean:write name="product" property="productID" /> </td>
<td>productName = <bean:write name="product" property="productName" /> </td>
<td>price = <bean:write name="product" property="price" /> </td>
<td><textarea name="description" cols="25" rows="5">
<bean:write name="product" property="price" />
</textarea> </td>
<td>test</td>
</tr>
</logic:iterate>

Hope it helps
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61201
    
  66

I'd avoid the proprietary <logic:iterate> tag in favor of the standardized JSTL tags (e.g. <c:forEach>).

That will allow you to perform the iteration with no scriptlet code.



[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
So you got something good.

Minimal scriplets.



No scirplets.

cheers.
Mike Jeya
Ranch Hand

Joined: Apr 15, 2004
Posts: 54
thank u folks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How do I iterate the object which is in Session (in a JSP)?