问 :怎么把http请求转移到另外一个地址?
原创文章。。。
解决方案+最佳答案:
ServletContext.getRequestDispatcher(String url)和ServletRequest.getRequestDispatcher(String url)只能把请求转移到同一个Web App中的地址。
如果需要把请求转移到另外一个Web App中的某个地址,可以按下面的做法:
1. 获得另外一个Web App的ServletConext对象(currentServletContext.getContext(uripath)).
2. 调用ServletContext.getRequestDispatcher(String url)方法。
问答来源:http://www.qi788.com/solution-3.html
本文转自yjflinchong 51CTO博客,原文链接:http://blog.51cto.com/yjflinchong/1164925,如需转载请自行联系原作者