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
Write a program to show the functionality of servlets.
How servlets are deployed in java?
What is the servletconfig object?
What are the steps involved in placing a servlet within a package?
When should you prefer to use doget() over dopost()?
What are the advantages of servlets over traditional cgi?
How the JSP file will be executed on the Server side?
What is meant by session? Tell me something about httpsession class?
How do cookies work in servlets?
What is the need of session tracking in web application?
What is difference between PrintWriter and ServletOutputStream?
What do you understand by mime type?
What is servlet in tomcat?
When servlet object is created?
What is the difference between servlet and filter?