RequestDispatcher可以在其他Web应用程序中进行URL [英] RequestDispatcher to url in a different web app

查看:111
本文介绍了RequestDispatcher可以在其他Web应用程序中进行URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在同一工作空间中将RequestDispatcher用于外部Web应用程序

How can i use RequestDispatcher to an outher web app in the same work space

在第一个网络应用中,我像这样使用它

in the 1st web app i use it like that

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

我可以用

此网址:

http://localhost:8080/SpeedyServiceClient/JSP/Search/indexS.jsp

推荐答案

如果要转发到同一tomcat实例中的其他Web应用程序,则可以:

If you want to forward to a different web app in the same tomcat instance, you can:

  • 在其META-INF/context.xml<Context crossContext="true" />
  • ,其中app是另一个应用程序的名称.
  • in its META-INF/context.xml set <Context crossContext="true" />
  • getServletContext().getContext("/app").getRequestDispatcher("f.jsp").forward(..);, where app is the name of the other application.

这篇关于RequestDispatcher可以在其他Web应用程序中进行URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆