• 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

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: 67747
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???
 
There is no "i" in denial. 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