struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Germuska <>
Subject Re: dynamically collect a series of String values to a vector property in an ActionForm
Date Tue, 09 Jul 2002 22:30:00 GMT
In your ActionForm, represent the property as a String[], not a 
Vector.  The automated processing in Struts will add one value to 
that String Array for each HTML input element with that property name.

You can initialize it however you like in an Action that forwards to 
the input JSP, and you can change the String[] to a Vector (or an 
ArrayList if you don't need synchronization, which you probably 
don't) in the Action to which the form submits.

There may be more to your question which I didn't understand, about 
the number of values, but if all the properties (input fields) have 
the same name, then it doesn't matter how many of them there are.


At 11:40 AM -0700 2002/07/09, Struts Newsgroup ( wrote:
>Subject: dynamically collect a series of String values to a vector 
>property in an ActionForm
>From: "tom" <>
>  ===
>How can I initialize a vector of Strings and assign values to the Strings in
>jsp (view component) so that an ActionForm can collect the vector property
>(a collection of String values) dynamically which depends on the number
>values to be grasped from the submission form?
>Thank you very much
>To unsubscribe, e-mail:   <>
>For additional commands, e-mail: <>

* Joe Germuska    { }
"It's pitiful, sometimes, if they've got it bad. Their eyes get 
glazed, they go white, their hands tremble.... As I watch them I 
often feel that a dope peddler is a gentleman compared with the man 
who sells records."
	--Sam Goody, 1956
tune in posse radio: <>

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

View raw message