First thing you have to set your form object in either session or
request by in action classs
        if("request".equals(mapping.getScope())) {
            request.setAttribute(mapping.getAttribute(),form);
        }else {
            request.getSession().setAttribute(mapping.getAttribute(),
form);
        }

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

Regards,
Sp




-----Original Message-----
From: Sonu S [mailto:[EMAIL PROTECTED] 
Sent: Friday, May 12, 2006 10:27 AM
To: user@struts.apache.org
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;
myForm.setMyList(testList);

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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to