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 exactly is a servlet?
What do you mean by servlet?
How is a servlet implemented in code?
Explain the architechure of a servlet?
What are the objects involved when a servlet receives a call from client?
How do I use cookies to store session state on the client?
What are the differences between servlet context vs servlet config?
What is servlet name in web xml?
What is the servlet?
Explain the servlet context.
What is session?
How we can call a jsp from the servlet?
What are all the ways for session tracking?
Can a jsp be called using a servlet?
What is the use of welcome-file-list?