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 the concept of single thread model interface is used?
What is a cookie What is the difference between session and cookie
What are different ways for servlet authentication?
What is a web container and what is its responsibility?
What are the benefits of using servlet over cgi?
List out the difference between ServletConfig and ServletContext?
What are sessions in servlets?
Explain servlet.
Should I override the service() method?
Why is it that we can't give relative URL's when using ServletContext.getRequestDispatcher() when we can use the same while calling ServletRequest.getRequestDispatcher()?
What is the use of welcome-file-list?
Why do we have servlet wrapper classes?
Whether we can get deadlock situation in servlets?
When servlet is loaded?
Explain the servlet context.