Answer Posted / sonam
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.http.RequestDispatcher;
public class dispatcher extends HttpServlet throws
IOException, ServletException {
public void doGet(HttpServletRequest request,
HttpServletResponse response) {
RequestDispatcher dis=
request.getRequestDispatcher("welcome.jsp");
dis.forward(request, response);//it will go to ur
desired page.
dis.include("Hello java");//it will display ur
message also to ur desired page.
}
}
| Is This Answer Correct ? | 10 Yes | 5 No |
Post New Answer View All Answers
How to rectify errors in java servlet while compilation?
What is a deployment descriptor?
What are the types of Session Tracking ?
What are the difference between session and cookies in servlet? Explain
What do you mean by annotations in servlet?
What are the difference between RMI and Servlets?
Why do we use sendredirect() method?
What is servlet and its types?
How servlet is created?
What is servlet name in web xml?
What is difference between ServletResponse sendRedirect() and RequestDispatcher forward() method?
What’s the difference between genericservlet and httpservlet?
What is the difference between Difference between doGet() and doPost()?
What's the architecture of a servlet package?
what is servlet chaining?