aspose file tools*
The moose likes Struts and the fly likes Garbage Values in TextBoxes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Garbage Values in TextBoxes" Watch "Garbage Values in TextBoxes" New topic
Author

Garbage Values in TextBoxes

Jobin Mathew
Ranch Hand

Joined: Oct 17, 2006
Posts: 83
Hi,
I created dynamic number of textboxes with the same name. Just like this

<html:text property="names"></html:text>
<html:text property="names"></html:text>
<html:text property="names"></html:text>


and in FormBean I give String[] type for this.

public String[] getNames()
{
return names;
}

public void setNames(String[] names)
{
this.names = names;
}

I am getting the values correctly, but when i take the page again the text boxes are filled with the String[] instead of each value in each textbox,
ie [Ljava.lang.String;@16bbe53 is shown in all 3 textboxes.
Do anyone know why this is happening?
If this method of taking values from textbox is incorrect, please correct me.

Thanks in Advance.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Essentially the same question was answered recently in this thread. The first solution proposed in the thread is incorrect, though. The right answer is the fourth post from the end of the thread.


Merrill
Consultant, Sima Solutions
Jobin Mathew
Ranch Hand

Joined: Oct 17, 2006
Posts: 83
Ok Thanks
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Garbage Values in TextBoxes