How to call java method in jsp page on button click?
Answer / Vishal Kumar Tiwari
To call a Java method in a JSP page on button click, you can use the scriptlet syntax or JavaBeans components. Here is an example using scriptlets: n```jspn<html>n<body>n<form action='' method='post'> <!-- form submission will trigger the script -->n <input type='submit' value='Submit' />n<script language='java'> <!-- Java scriptlet -->n public void _init() { request.setCommand("myMethod"); }n</script>n</body></html>``` In this example, myMethod is a method in the JSP page's underlying servlet.
| Is This Answer Correct ? | 0 Yes | 0 No |
Why jsp is better over static html also explain lifecycle of a jsp?
How do I perform browser redirection from a jsp page?
Which two interfaces does the javax servlet jsp package have?
What is jsp servlet?
What is the difference between JSP and Servlet?
21 Answers HCL, T3 Softwares, Tibco,
What are the components that make up a tag library in jsp?
A jsp page, include.jsp, has a instance variable "int a", now this page is statically included in another jsp page, index.jsp, which has a instance variable "int a" declared. What happens when the index.jsp page is requested by the client?
Explain the advantages of jsp?
i am using rich faces datatable rich:datatable. On entering the value, values get filtered in table. Now how can i get the value in back9ing bean..?
What is the use of jstl tags in jsp?
How to implement a thread-safe jsp page?
What is the use of jstl?