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 meant by session? Tell me something about httpsession class?
Differentiate between the get and post method
When to use doget() and when dopost()?
What is servlet container. how it works?
What are the steps that are involved in using the httpservlet class?
What is servlet container?
Explain request dispatcher and its methods.
What is the main purpose of java servlets?
What are the steps that are required to handle the multi-threading?
Is servlet synchronized?
What do you mean by cgi?
How do I support both get and post from the same servlet?
What's the difference between servlets and applets?
What is meant by a web application
How is a servlet implemented in code?