• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

String[] is null upon reaching Action

 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all, in my form i have a String[] which i fill using html:text tags. However when i reach the action in which i need the String[] it is null. What can i do to resolve this?
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not exactly following what you mean that you have a String[] in your form?

Are you saying that you have multiple textfields that all have the same name?

-k
 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes i have a String[] that compares to multiple text fields in the jsp. When i go into the action i guess the form resets and the String[] is null.
 
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Name of the String [] and name of that HTML element should be same or getting the value in the action . Are you using the same name ???
 
Theo van Loon
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok situation now is as follows :

I have two action : one that initializes a shoppingcart and one dispatchaction that updates, deletes etc. In my form i have a map which contains key : product id and value is a String object containing the amount.

my form contains the following methods :




In my JSP i have the following code :


This works for displaying purposes. So it shows the correct amount. Question is though what can i do to update the amounts. When it reaches the action the map is null. Perhaps place the map in the request, but is it then possible to write to the given object using html:text tag.

Does anyone know how to deal with this issue???
[ February 28, 2005: Message edited by: Theo van Loon ]
 
Men call me Jim. Women look past me to this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic