You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Balazs Michnay <sz...@yahoo.com> on 2007/04/13 10:09:27 UTC

Form data to Vector

Hi,

I have a form with two submit buttons. One should add the content of a text field to a Vector (which is in the form bean?), and the other one should point to another page that has access to the Vector values.
I'd like to know how to add form data to a Vector.
Any help would be appreciated.

Thanks a lot,

MB



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: Form data to Vector

Posted by Martin Gainty <mg...@hotmail.com>.
Balazs

Take a look at
http://struts.apache.org/1.0.2/api/org/apache/struts/taglib/logic/package-summary.html
you will see this example of implementing a vector via use of struts 
logic:iterate in your jsp

<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%
  java.util.Vector vector = new java.util.Vector();
  vector.add(new Integer(12));
  vector.add(new Integer(5));
 %>
<logic:iterate id="myCollectionElement" collection="<%= vector %>">
 Do something with myCollectionElement
</logic:iterate>
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

----- Original Message ----- 
From: "Balazs Michnay" <sz...@yahoo.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Friday, April 13, 2007 4:09 AM
Subject: Form data to Vector


> Hi,
>
> I have a form with two submit buttons. One should add the content of a 
> text field to a Vector (which is in the form bean?), and the other one 
> should point to another page that has access to the Vector values.
> I'd like to know how to add form data to a Vector.
> Any help would be appreciated.
>
> Thanks a lot,
>
> MB
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com 


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