如何RequestDispatcher在同一工作空间中使用外部Web应用程序
在第一个Web应用程序中,我使用它
RequestDispatcher rd =request.getRequestDispatcher("vote.jsp");
rd.forward(request, response);
Run Code Online (Sandbox Code Playgroud)
我可以代替vote.jsp用
这个网址:
http://localhost:8080/SpeedyServiceClient/JSP/Search/indexS.jsp
如果要转发到同一tomcat实例中的其他Web应用程序,您可以:
META-INF/context.xml集合<Context crossContext="true" />getServletContext().getContext("/app").getRequestDispatcher("f.jsp").forward(..);,app其他应用程序的名称在哪里.如果您要访问不同的服务器/ servlet上下文,那么更典型的是......
response.sendRedirect("http://localhost:8080/SpeedyServiceClient/JSP/Search/indexS.jsp");
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
10529 次 |
| 最近记录: |