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
Why servlet is faster than jsp?
What is servlet in web technology?
In the servlets, we are having a web page that is invoking servlets ,username and password? which is checks in database? Suppose the second page also if we want to verify
What is the process for chaining servlet?
What’s the difference between genericservlet and httpservlet?
What’s the difference between forward() and sendredirect() methods?
What is cookie? Why is cookie used?
What are the phases of the servlet life cycle?
What is meant by Servlet? What are the parameters of service method?
Can you explain in detail 'javax.servlet' package?
What is servlet and its advantages?
What are the different ways we can maintain state between requests?
What is the capacity the doget can send to the server?
How do I support both get and post from the same servlet?
What are common tasks performed by Servlet Container?