Forward Call from a Servlet : Forward « Servlet « Java Tutorial






import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class Main extends HttpServlet {

  protected void service(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {

    RequestDispatcher dispatcher = request.getRequestDispatcher("/p.jsp");

    dispatcher.forward(request, response);
  }

}








25.16.Forward
25.16.1.Forward Call from a Servlet
25.16.2.Forward to another location