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 do you mean by cgi in servlet?
Why is Servlet so popular?
Why are http servlets used in programming?
What are important features of Servlet 3?
Explain mvc pattern.
Write a hello world program using servlets.
Can you explain in detail 'javax.servlet' package?
What is the purpose of requestdispatcher interface?
What is the use of java servlet api?
What are the two important api's in for servlets?
List out difference between a JavaBean from a Servlet?
Explain url encoding?
What is servlet and how it works?
Whether we can get deadlock situation in servlets?
What are some disadvantages of storing session state in cookies?