<%!
public void display()
{
System.out.println("Hai");
}
%>
<input type="submit" value="touch me" method="display()"/>
I have a jsp page like above. How can i call a method when the user clicking the button.The above code is not working. How i do it without javascript...
You are confusing server side and client side. The code is generated on the server side, your user clicks on the client side. If you want to call server side code from the client side you need to look into ajax.
If you want to carry out events on the client side you need to use javascript