Yep, you can't pass a String array as a single input/hidden, unless
you're willing to handle marshalling it to/from a single-string
representation. Far easier would be to expose the array as an index
property and serialize it to/from the view using a set of hidden inputs.
L.
[1] http://struts.apache.org/1.2.9/userGuide/building_view.html#indexed
Anet wrote:
Hi;
Thank very much for your help, but my string[] object filled dynamic.I don't know its size at first.
and I don't need its data on my form, I just need them to pass with form when
the form is submitted.
also your solution can help me. just I want to know something.
I saw in a document that only String type can be used with <html:hidden>. Is this my error? trying to pass array
with <html:hidden>??
thanks a lot.
WongTsengÍõÔø <[EMAIL PROTECTED]> wrote:
Maybe you can make your String[] Object a indexed attribute of your
formbean. Then use html:hidden:
something like this below:
Class YourFormBean extends ActionForm{
String[] aaas = new String[5];
public String getAaa(int index){
return aaas[index];
}
public void setAaa(String a,int index){
aaas[index] = a;
}
}
then in your jsp:
2006/10/20, Anet :
Hi everybody;
I have a String[] object. but I can't pass it via form as a hidden
object.
Is it wrong to pass a string[] object as html:hidden ???
Thanks.
---------------------------------
How low will we go? Check out Yahoo! Messenger's low PC-to-Phone call
rates.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]