• 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

logic:iterate Tag

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I having array list having values of Vendor name from database and i am setting that value in session.

session.setAttribute("vendorname",vendorAL);

I am getting this value in JSP page using the code given below

vendorArrLst = (ArrayList)session.getAttribute("vendorname");


I need to get the value from the ArrayList(vendorArrLst) and display the values using logic:iterate tag in my JSP page.

kindly explain me the above case with help of coding.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here's a link to the documentation on the logic:xxxx tags.

http://struts.apache.org/struts-doc-1.2.8/api/org/apache/struts/taglib/logic/package-summary.html#package_description

Give it a try, and see what you come up with. If it doesn't work, and you still need help, let us know.

Personally, though, I've stopped using logic:xxx tags in favor of JSTL (Java Standard Tag Library) as they are more standard. Here's a link on JSTL:

http://www.onjava.com/pub/a/onjava/2002/08/14/jstl1.html?page=1

You can also google "JSTL tutorial" and get a number of other good links.
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

Try the following code and if you still have any problem.then contact me

<%@ taglib uri="struts/logic-l" prefix="logic-l" %>
<logic-l resent name="vendorArrLst " >
<bean:size id="size" name="vendorArrLst " />

<logic-l:greaterThan name="size" value="0">
<bean:write name="size"/>
<logic-l:iterate id="lt" name="vendorArrLst ">
<bean:write name="lt"/>
</logic-l:iterate>
</logic-l:greaterThan>
</logic-l resent>
 
My name is Inigo Montoya, you killed my father, prepare to read a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic