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 batch updates. in jdbc
What is the immediate parent class of the Applet class?
Explain treeset?
can we create a instance for intwerface?
is this possible to create an array of 0 length? if so how? if not so why? coz we have an array in main() likw this "static void main(String [] s) then what it signifies?
Explain role of constructor in a java application?
In how many ways we can do synchronization in java?
What is try-with-resources in java?
What is the use of put method?
What are the new features in java 8? Explain
Explain about assignment statement?
What is JVM ?
4 Answers Phantom Technologies, TCS,