• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So you got something good.

Minimal scriplets.



No scirplets.

cheers.
 
Mike Jeya
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank u folks
 
I'm full of tinier men! And a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic