struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Patil, Sheetal" <>
Subject RE: Accessing List in JSP
Date Fri, 12 May 2006 05:04:35 GMT
First thing you have to set your form object in either session or
request by in action classs
        if("request".equals(mapping.getScope())) {
        }else {

And then you have to use name of your action form registered in
struts-config.xml in <logic:iterate name="    here    ">

Check out if it work  and reply


-----Original Message-----
From: Sonu S [] 
Sent: Friday, May 12, 2006 10:27 AM
Subject: Accessing List in JSP

Hi 2 all

I am using Struts 1.2

in my action class i am writing

List testList = new ArrayList();

testList.add("str 1");
testList.add("str 2");
testList.add("str 3");

MyForm myForm = (MyForm) form;

In Action Form i have done
public class myForm extends ActionForm{
    List myList;

    public List getMyList() {
	 return MyList;
    public void setMyList(List MyList) {
	 this.MyList = MyList;

I want to access this List in JSP.

I am trying <logic:iterator> butit is not working. I am trying

<logic:iterate id="test" name="myForm" property="myList" > <bean:write
name="test" property="myList"/>

Could u please tell me how to access List in JSP page

Thank you
With regards

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message