This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

logic:iterate Tag

 
Gopinath Reddy
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • 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.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • 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.
 
pankajjj jain
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • 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>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic