This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
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 Building Microservices this week in the Design 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: 63227
    
  69

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


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
Have you checked out Aspose?
 
subject: String array in form
 
It's not a secret anymore!