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
What is war file?
What is context in servlet?
What is the use of httpservletrequestwrapper and httpservletresponsewrapper?
How do you design microservices?
Explain the architechure of a servlet?
How does java thread pool work?
Explain web application directory arrangement?
How does Cookies work in Servlets?
What is the use of servlet wrapper classes?
how the HTML data stored in web server?
How can the session in servlet can be destroyed?
Explain the difference between jsp and servlet?
What is the GenericServlet class?
How do you communicate in between Applets and Servlets?
What exactly are the functions of servlet?