Java servlet not dispatching to another servlet

前端 未结 4 1268
无人共我
无人共我 2021-01-24 08:58

I have 2 servlets, \"HomeController\" and \"SearchController\". On the home.jsp I have a form that has a search box and when submitted actions to \"Search\"

 <         


        
4条回答
  •  日久生厌
    2021-01-24 09:12

    You can use getNamedDispatcher:

    ServletContext context = getServletContext();
    RequestDispatcher requestVar = context.getNamedDispatcher("HomeController");
    

提交回复
热议问题