在重定向的外部URL上设置标头 [英] Setting headers on redirected external URL

查看:238
本文介绍了在重定向的外部URL上设置标头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

jsf应用程序是否可以导航到外部链接并指定该外部链接的标头?
到目前为止,我试图调用支持bean方法:

Is it possible that a jsf application can navigate to an external link and specify headers for that external link? So far I have tried to call in the backing bean method:

ExternalContext#setResponseHeader(java.lang.String name, java.lang.String value)
ExternalContext#redirect(java.lang.String url) 

重复次数成功执行但标题丢失。
有没有办法指定带有标题的链接?

The redicection is successfully executed but the Headers are lost. Is there any way to specify a link accompanied with the headers?

推荐答案

不,HTTP不允许在不同的请求上设置标头。

No, HTTP doesn't allow setting headers on a different request.

标题必须由目标URL后面的代码设置。 您错误地认为以这种方式解决的任何问题肯定会以不同方式解决

The headers have to be set by the code behind the target URL. Whatever problem you incorrectly thought to solve this way has definitely to be solved differently.

这篇关于在重定向的外部URL上设置标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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