You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "vineesh . kumar" <vi...@rediffmail.com> on 2004/08/18 09:12:45 UTC

Accessing collections in jsp

  
To pass a range of values i used 
in PassAction.java
        Vector v=null;
          v.add("somestring");
           v.add("someotherstring");

request.setAttribute("name",v);

and in the jsp i tried to access it like

         <logic:iterate id="mylist" name="list">
  Element Value: <bean:write name="mylist" /><br />
</logic:iterate>

but i got an error saying 

javax.servlet.ServletException: Cannot find bean list in scope request

anyone know wat is this problem
    my struts-config action mapping is
           

<action 
        	path="/accountslisting" 
        	type="com.c2rmnet.struts.action.AccountslistAction" 
        	validate="false">
            <forward name="success" path="/form/AccountListing.jsp" />
            <forward name="invalidsession" path="/form/InvalidSession.jsp" />
        </action>

Thanks 
   vinu

Re: Accessing collections in jsp

Posted by Bill Siggelkow <bi...@bellsouth.net>.
Vector v=new Vector();
           v.add("somestring");
            v.add("someotherstring");

request.setAttribute("list",v);


<logic:iterate id="mylist" name="list">
   Element Value: <bean:write name="mylist" /><br />
</logic:iterate>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org