Setting headers on redirected external URL

三世轮回 提交于 2019-12-13 07:35:42

问题


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?


回答1:


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

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.



来源:https://stackoverflow.com/questions/28618002/setting-headers-on-redirected-external-url

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!