• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Garbage Values in TextBoxes

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok Thanks
 
look! it's a bird! it's a plane! It's .... a teeny tiny ad
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic