Sonu,

Make two changes in your code, it will definitely work..

1. Add the following line in your Action Class:
        request.setAttribute("myForm",myForm);
2. Modify the JSP code 
        <logic:iterate id="test" name="myForm" property="myList" > 
                <bean:write name="test" />
        </logic:iterate>

Hope it helps.....

Thanks & Regards
Sunil Sahu





Sonu S <[EMAIL PROTECTED]> 
05/12/2006 10:27 AM
Please respond to
Struts Users Mailing List <user@struts.apache.org>


To
user@struts.apache.org
cc

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]

Reply via email to