This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
Is there any other method, may be after I hit the submit button? I need to pass the selected value from a student dropdown list to a jsp setMethod(). So for example if I select, Jon from a Dropdown list which has a ID = 5, then I need to pass 5 to the java method.
Originally posted by zub kodi: I need to pass a selected value from the Form Dropdown into a java setMethod() in my jsp page. But I can't seem to figure out how?
That's because you can't.
You might find this article helpful in understanding JSP concepts. [ April 03, 2008: Message edited by: Bear Bibeault ]
To communicate with the server after the page has been loaded, you either need to submit the page back to the server, or send a request to the server via Ajax. As you will realize after reading the linked article, you can't just call Java methods from script -- especially any methods in the JSP that created the page.
(And before anyone gets the bright idea of mentioning DWR, that's just a special case of Ajax and should not even be considered before thoroughly understanding how HTTP, JSP and the whole Ajax ball of wax works.)