I have a jsp where i have two buttons. Each button runs a script on click and then in the script i invoke submit(the action is to a servlet)... my problem is when the script invokes submit, it goes to the servlet...but the value of the button that was clicked is not read...... Kindly provide a solution.....

8 Years
Discussion Span
Last Post by Thirusha

here my prob is the servlet doesnt recognise the particular button clicked....... and the name of the button is not read in the servlet..... when i print the value and see it displays null.....

  1. I think adatapost approach is better then messing around with JavaScript
  2. If you want help you better show code, we have no idea what you tried and blind advice will take forever

In that previous post, it helped.. but in this problem i m suggesting, there is a script that has to run once the button is clicked and then it is forwarded to servlet. so i wanted to know what can be done to read the value of the button in the servlet... i used request.getParameter()...but when i print the value and see, it returns null.....


when using request.getParameter, the parameter must be in the url.
so make sure when u call the servlet the name of the button has been sent and the url will look something like this

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.