Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Garbage Values in TextBoxes

 
Jobin Mathew
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jobin Mathew
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic