How can we forward the request from jsp page to the servlet?



How can we forward the request from jsp page to the servlet?..

Answer / Ayushi Singh

To forward a request from a JSP page to a Servlet, you can use the RequestDispatcher object. The following code demonstrates an example: <% PageContext pc = request.getPageContext(); RequestDispatcher rd = pc.getRequestDispatcher("/ServletName"); rd.forward(request, response); %>

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More JSP Interview Questions

Is jsp a programming language?

1 Answers  


What are scripting elements?

1 Answers  


What is the difference between jsp and php?

1 Answers  


What are different implicit objects of jsp?

1 Answers  


What does it mean when tags or attributes are said to be deprecated?

1 Answers  


Can we write a class inside Jsp?

1 Answers  


What is jsp standard tag library, provide some example usage?

1 Answers  


What is jsp life cycle?

1 Answers  


How we can configure init params in jsp?

1 Answers  


How do I prevent the output of my jsp or servlet pages from being cached by the browser?

1 Answers  


What are the advantages of jsp?

1 Answers  


Explain jsp:plugin action?

1 Answers  


Categories