Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) 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
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!