File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes get parameters from select Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "get parameters from select" Watch "get parameters from select" New topic
Author

get parameters from select

David Avrami
Ranch Hand

Joined: Sep 10, 2011
Posts: 30

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

Joined: Sep 10, 2011
Posts: 30

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

Joined: Jan 10, 2002
Posts: 61773
    
  67

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
David Avrami
Ranch Hand

Joined: Sep 10, 2011
Posts: 30

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???
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: get parameters from select