wood burning stoves 2.0*
The moose likes Struts and the fly likes logic:iterate  Tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "logic:iterate  Tag" Watch "logic:iterate  Tag" New topic
Author

logic:iterate Tag

Gopinath Reddy
Greenhorn

Joined: Oct 30, 2005
Posts: 3
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

Joined: Feb 15, 2005
Posts: 4864
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.


Merrill
Consultant, Sima Solutions
pankajjj jain
Greenhorn

Joined: Oct 12, 2005
Posts: 14
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>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: logic:iterate Tag
 
Similar Threads
Displaying Values in JSP Page using Struts
Logic Iterate Problem
Displaying values in JSP using Struts Tag
I need ur support in sorting out the struts issue
Problem displaying data in table