struts2请求跳转到外部链接

来源:互联网 发布:淘宝店铺怎么提现 编辑:程序博客网 时间:2024/06/11 22:06

当使用搜索引擎搜索Struts2如何跳转到外部链接的时候,大多数答案是:

<result name=”foo” type=”redirect”>${externalUrl}</result>

这种方式实际不会达到跳转到外部链接的效果。

在struts2中可以使用301、302的方式跳转:

<result name=”foo” type=”httpheader”><param name=”status”>301</param><param name=”headers.Location”>${externalUrl}</param></result>




参考:http://peekay.org/2008/09/03/struts2-external-redirect/

0 0
原创粉丝点击