我在使用时遇到问题<redirect/
> 关于导航规则。我的应用程序在 HTTPS 上运行并且当导航规则使用时<redirect/
> 重定向到 HTTP,而不是 HTTPS。有什么办法可以解决这个问题吗?
您应该实施自定义ConfigurableNavigationHandler这将根据操作的来源重新映射 URL(我假设并非所有重定向都到 https 目的地)。举个例子:
public class NavigationHandlerTest extends ConfigurableNavigationHandler {
private NavigationHandlerTest concreteHandler;
public NavigationHandlerTest(NavigationHandler concreteHandler) {
this.concreteHandler = concreteHandler;
}
@Override
public void handleNavigation(FacesContext context, String fromAction, String outcome)
{
//here, check where navigation is going to/coming from and based on that build an appropriate URL.
if(outcome.equals("someAction"){
outcome = "https://foo.bar.baz"; //set destination url
}
concreteHandler.handleNavigation(context, fromAction, outcome);
}
}
注册您的实施面孔配置.xml
<application>
<navigation-handler>com.example.NavigationHandlerTest</navigation-handler>
</application>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)