Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/345.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Wildfly-8.2.1中的港口统一_Java_Https_Wildfly 8_Ear - Fatal编程技术网

Java Wildfly-8.2.1中的港口统一

Java Wildfly-8.2.1中的港口统一,java,https,wildfly-8,ear,Java,Https,Wildfly 8,Ear,我有一个EAR应用程序,它的结构如下 abc.ear def.war 战争 ghi.jar 应用程序在Wildfly服务器上运行良好,如下所示: HTTP: HTTPS: 我想将所有HTTP(端口8080)请求重定向到HTTPS(端口8443)。 我们衷心感谢您的帮助 如果我理解正确,您有一个打包在EAR文件中的webapp。因此,您可以在webapp web.xml中添加以下内容: <security-constraint> <web-resource-colle

我有一个EAR应用程序,它的结构如下

abc.ear

  • def.war
  • 战争
  • ghi.jar
应用程序在Wildfly服务器上运行良好,如下所示:

  • HTTP:
  • HTTPS:
  • 我想将所有HTTP(端口8080)请求重定向到HTTPS(端口8443)。

    我们衷心感谢您的帮助

    如果我理解正确,您有一个打包在EAR文件中的webapp。因此,您可以在webapp web.xml中添加以下内容:

    <security-constraint>
        <web-resource-collection>
            <web-resource-name>everything</web-resource-name>
            <url-pattern>/*</url-pattern>
        </web-resource-collection>
        <user-data-constraint>
            <transport-guarantee>CONFIDENTIAL</transport-guarantee>
        </user-data-constraint>
    </security-constraint>
    
    
    一切
    /*
    保密的
    
    因此,如果用户通过浏览器使用http://...,它将被“重定向”到https://...


    注意:您还必须在Wildfly security realms中配置SSL,但我假设您已经这样做了

    您是否选中了此选项?是的,但该链接仅有助于保护web应用程序。