Two Laptop Bag
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 Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply locked New topic

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[]" />

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;


document.forms[0].stringsSelected = myJSStringArray;


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?.

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63334

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:
subject: String array in form
It's not a secret anymore!