2015-10-07 23 views
2

我的web.xml中具有下列安全约束:如何在Wildfly 8.2中从http重定向到https?

<security-constraint> 
    <web-resource-collection>  
     <web-resource-name>App</web-resource-name> 
     <url-pattern>/*</url-pattern> 
    </web-resource-collection> 
    <user-data-constraint> 
     <transport-guarantee>CONFIDENTIAL</transport-guarantee> 
    </user-data-constraint> 
</security-constraint> 

此配置通过302个重定向重定向所有的HTTP URL为https。除了通过Wildfly 8.2中的301重定向以外,还有其他方法可以实现吗?

+0

我能想到的唯一的事情就是编辑承诺本身....不知道如何做到这一点,虽然。 – Brooks

+2

您确实需要定制['ServletExtension'](https://http2.undertow.io/documentation/servlet/servlet-extensions.html)。我现在只能从头顶部看不到实现细节。 – BalusC

+0

@BalusC,我会看看这种方法。如果您能找到时间提供示例,我将不胜感激。在此之前我会继续阅读。 – k170

回答