This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Struts and the fly likes passing multiple values through hidden variables Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "passing multiple values through hidden variables" Watch "passing multiple values through hidden variables" New topic
Author

passing multiple values through hidden variables

sandy gupta
Ranch Hand

Joined: Jan 30, 2001
Posts: 228
Hi

I am trying to pass multiple values through a hidden variable on a form post but am not getting the values in my form bean. What am i doing wrong?

jsp:

<html:hidden property="svalues" value="abc, def"/>

bean:

private String []svalues = null;

public String []getSvalues(){
return svalues;
}

public void setSvalues(String []values){
svalues = values;
}

TIA
S


Adios
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12324
    
    1
The value of form parameter such as svalues is always going to be a String, not a String[]. You are going to have to parse that String yourself.
Bill


Java Resources at www.wbrogden.com
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: passing multiple values through hidden variables
 
Similar Threads
Possibility for (Custom type objects) & (object arrays) in Form Bean
Form submit to bean reading null values
Struts Form Beans & Multicheckboxes
large form spanning across multiple jsp's
Action Form not populate with JSP hidden value