0

Can anybody help me how can I invoke a JSP page from a Servlet (just have to invoke, no need of passing parameters).

1
  • 3
    Put your mouse above the [servlets] tag which you've placed on the question yourself until a black info box shows and then click therin the info link.
    – BalusC
    Jun 14, 2012 at 15:40

2 Answers 2

2

Use the forward() or include() method of the RequestDispatcher (Docu):

getServletContext().getRequestDispatcher( "yourJspPath" )
                   .forward(request, response);
1

Not sure what 'invoke' is supposed to mean, but if we're talking about redirecting, it could be done like that:

response.sendRedirect("your.jsp");

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.