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 are the different types of servlets?
What is a generic servlet?
How will two or three servlets interact or communicate with each other?
What are session variable in servlets?
How can we include static files in the jsp page?
What do you mean by default initialization in java servlet?
What is a deployment descriptor?
What is the default http method in the servlet?
Name the different ways of session tracking.
Can you explain in detail 'javax.servlet' package?
How httpservlet is different from the genericservlet?
Explain web container.
Which event is fired at the time of session creation and destroy?
How can the session in servlet can be destroyed?
Why servlet is faster than jsp?