File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes String array in form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply locked New topic
Author

String array in form

basha khan
Ranch Hand

Joined: Jan 26, 2002
Posts: 516
I have an ActionForm in struts-config for eg,

<form-bean name="SomeForm" >
<form-property name="stringsSelected" type="java.lang.String[]" />
</form-bean>

In JSP, i am creating a hidden field for this property like,

<html:hidden property = "stringsSelected"/>

Now i want to to pass a javascript string array using this form property fuch as

<script type="javascript">

function aFunct(){

document.forms[0].stringsSelected.value = myJSStringArray;

//OR

document.forms[0].stringsSelected = myJSStringArray;

}
</script>

If property stringsSelected is a string instead of string [] it works, for String array it does'nt.

Is there any way to send a javascript arry to server using forms?.

Thanks,
Basha
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61415
    
  67

Please do not cross-post the same question in more than one forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: String array in form