how to get the button value from jsp to servlet in jsp:
<input type=button name=bt value=gi onclick="document.frm.submit();"></input>
and in servlet like that:
String gi =request.getParameter("bt");
System.out.print("button value" +gi);
result=null
thanks
Take a hidden variable inside form and use it like this.
Now, in the servlet,
Rather use
<input type="submit">
.Its name/value pair will be sent to the server side as well:
No need for JavaScript hacks/workarounds here. It would also break your application in case that the client has JavaScript disabled.
You need to convert the button parameter to String using .toString(). There is nothing wrong with your code.