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
Can filter be used as request or response?
What are the life cycle methods of a servlet?
Is servlet thread safe?
What is the servlet?
What is servlet and its advantages?
How to commuincate between an applet and a servlet?
What are the ways to handle multi-threading in servlets?
What is the difference between 2 types of servlets?
What is the procedure for initializing a servlet?
When is the servlet instance created in the life cycle of servlet? What is the importance of configuring a servlet?
Explain jsessionid?
Which are the different ways you can communicate between servlets?
How do you create a cookie using servlet?
Explain is servlet mapping?
Explain the difference between servlet and cgi?