How do I pass a value from JavaScript code to a servlet page?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As per my understanding , Create a hidden input field , set the value and submit to the action and get the hidden field value from servlet.
This shows a kick-off example , you can modify it according to your needs :
HTML Form :
Script :
You would user Request.getParameter to get this value from servlet .