• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Dropdown values not submitted

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, i have the following form

and this is how i plan to get the values

only "parameters exhausted ...." is displayed which means the param list is null/empty... Is JSTL setting 'username' parameter?
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what do you see in the HTML source for the select?
 
Sonx Nkuks
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

David O'Meara wrote:what do you see in the HTML source for the select?


i had to set the selected value to get it working


But still the getParameterNames didn't get me the values. I had to change code to the following to get it to work, not sure why
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I believe this is the correct behaviour, that is
1) if no value is selected, then the parameter name is not sent in the request, and getParameter() returns null
2) if a value is selected, then the parameter exists and the value is defined.

One solution is to provide a default value with an empty value, such as
 
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Sonx Nkuks wrote:Hi, i have the following form


Here, you have given the submit-button the same name you've given for your select box. You don't need a name for a submit button. Even if you provide, it'd be better to use a unique name.

HTH,
Vishwa
 
Sonx Nkuks
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Vishwanath Krishnamurthi wrote:Hi,

Sonx Nkuks wrote:Hi, i have the following form


Here, you have given the submit-button the same name you've given for your select box. You don't need a name for a submit button. Even if you provide, it'd be better to use a unique name.

HTH,
Vishwa



I removed the name attribute and gave it the value attribute... Another question on HTML, i need to do two things

1. Pass a list of objects from doGet() to doPost() .. should i just put it on HttpSession?
2. Keep track of the EJBRemote reference so that i don't have to look it up on the JNDI context everytime i need it. I tried putting it on the HttpSession but it becomes null

Thanks
 
Sonx Nkuks
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Th e HttpSession seems to be working for both
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic