how can i cal servlet from jsp page?how can i pass
variablesfrom the jsp that servlet can access?
Answer / ranjani
By using JSP forward attriputes within the html tag we can
just forward our page to servlet.or by using
response.sendRedirect()method we can call servlet page.
for example
-----------
<jsp:forward page="/relativepath/YourServlet" /> or
response.sendRedirect("http://path/YourServlet").
We can also pass the parameters in the same way to the
servlet
for example
-----------
<jsp:forward page=/relativepath/YourServlet>
<jsp:param name="name1" value="value1" />
<jsp:param name="name2" value="value2" />
</jsp:forward>
You may also pass parameters to your servlet by specifying
response.sendRedirect("http://path/YourServlet?
param1=val1").
| Is This Answer Correct ? | 11 Yes | 1 No |
What are the differences between abstract class and interface?
What are recursive functions? Give some examples?
0 Answers Axtria, ITC Indian Tobacco Company,
How can i add a button in applet in java ???
What primitive Java types? Howmany are they and what are their names?
What is a flag variable?
Can a final variable be initialized in constructor?
How do you declare an infinite loop?
what is singleton in java?
Can we override the static method?
What are the special characters?
Difference between this(), super()?
12 Answers College School Exams Tests, Oracle,
How do you remove an element from an arraylist in java?