Setting headers on redirected external URL

2019-09-03 13:41发布

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条回答
Bombasti
2楼-- · 2019-09-03 13:51

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.

查看更多
登录 后发表回答