Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

get parameters from select

 
David Avrami
Ranch Hand
Posts: 30
C++ Hibernate Java
  • Mark post as helpful
  • send pies
  • 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
C++ Hibernate Java
  • Mark post as helpful
  • send pies
  • 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..
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64702
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
C++ Hibernate Java
  • Mark post as helpful
  • send pies
  • 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???
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic