Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dropdown values not submitted

 
Sonx Nkuks
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • 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?
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
 
Vishwanath Krishnamurthi
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • Quote
  • Report post to moderator
Th e HttpSession seems to be working for both
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic