Passing data from servlet to another servlet using RequestDispatcher

前端 未结 2 517
说谎
说谎 2021-01-05 18:05

I am trying to pass data from one servlet to another using the RequestDispatcher. This is my code for the Dispatcher.

String address;

address = \"/Java Reso         


        
2条回答
  •  自闭症患者
    2021-01-05 18:30

    You can directly write your name of the servlet in request.getRequestDispatcher("your servlet name"); it will fetch the path according to the web.xml configuration.

    RequestDispatcher rd= request.getRequestDispatcher("MyServletName");
    rd.forward(request,response);
    

提交回复
热议问题