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 and its use?
What is dispatcher servlet?
How to create war file?
Tell the new features added in servletrequest interface i.e. Servlet 2.4
How forward () method is different from send redirect () method?
How to upload a file to the server using servlet?
How do cookies work in servlets?
Explain mvc pattern.
What are all the protocols supported by httpservlet?
What are the types of servlets? Explain
What is difference between server and servlet?
How can we implement a jsp page?
What is Servlets and explain the advantages of Servlet life cycle?
Write all the phases defined in servlet life cycle?
How do you find out what client machine is making a request to your servlet