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
How to get the server information in a servlet?
how the HTML data stored in web server?
What's the difference between authentication and authorization?
What is URL Encoding?
What is the directory structure of web application?
what do you understand by url rewriting?
How can the session in servlet can be destroyed?
What is the difference between jsp and servlet life cycle?
What is the capacity the doget can send to the server?
What is the servlet?
How can the session in servlet be destroyed?
What is the type of method for sending request from http server?
If some new data has entered the database, explain how can a servlet refresh automatically?
Why doesn’t a servlet include main()? How does it work?
What is the difference between the getrequestdispatcher(string path) method of javax.servlet.servletrequest interface and javax.servlet.servletcontext interface?