Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

get parameters from select

 
Ranch Hand
Posts: 30
Hibernate C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
i have tried some of the methods i read about this and it seems not working just for me..
i want to get the selected value of a Select. my HTML:


the AdminWorkSpace is the same page reloading it self onChange(), the idea is to retrieve data from the server and change Html accordingly.

in my servlet:

System.out.println(request.getParameter("Combobox1"));

it keeps writing me "null" and it also goes like this for getParameterValues("Combobox1");
and getParameterMap() showing empty braces: "{}"

thank you in advance.
 
David Avrami
Ranch Hand
Posts: 30
Hibernate C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think i got it, i should use the GET method and not the POST although my implemented the doGet method:

protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
doPost(request, response);
}

i wonder y..
 
Sheriff
Posts: 67636
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There should be no difference between POST and GET. But it's hard to tell because your HTML is unreadable as posted. Please read UseCodeTags to learn how to post code in a more readable format.

Also your quotes all got escaped with \. Prevent that when reposting the code.
 
David Avrami
Ranch Hand
Posts: 30
Hibernate C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the correction about the readability.
but still..it got my problem fixed by changing the POST to GET method.
maybe it is something to do with the fact that i am writing a Hebrew letters.
The Select originally is like:



something about the encoding perhaps.
doe's any one have a bulletpruf answer for that???
 
For my next feat, I will require a volunteer from the audience! Perhaps this tiny ad?
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic