Answer Posted / avinah kapoor
import javax.servlet.*;
import javax.servlet.http.*;
public class RequestDispatcherDemo extends HttpServlet
{
public void doGet(HttpServletRequest
req,HttpServletResponse res) throws ServletException
{
res.setContentType("text/html");
PrintWriter out=res.getWriter();
RequestDespatcher rd=req.getRequestDispacher("welcome");
rd.forward(req,res);//it forwart the response to
welcome servlet page but cant take resource calling page.
}
}
Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What is servlet instance?
Explain the lifecycle of a servlet?
What are the jobs performed by servlets?
Explain how does JSP handle run-time exceptions?
What is a servlet context?
How do you configure a centralized error handler in servlets?
What is the purpose of requestdispatcher interface?
How do we call one servlet from another servlet?
What is servlet looping or chaining?
What is preinitialization of a servlet?
What is servlet in simple terms?
What is a server side include (ssi)
What is the GenericServlet class?
What are the life-cycle methods for a servlet?
What is the use of welcome-file-list?