【问题标题】:What's is the use of <security-constraint> in web.xml in Google app engine GWT JavaGoogle 应用引擎 GWT Java 中 web.xml 中 <security-constraint> 的用途是什么
【发布时间】:2016-05-14 05:50:33
【问题描述】:

我正在谷歌应用引擎上使用 GWT java 开发项目。我想使用 https 访问我的应用程序,以便可以使用“myapp-dot-appspot.com”访问我的应用程序。但是,我想知道有什么用:

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

web.xml 中的配置。

【问题讨论】:

    标签: java xml google-app-engine ssl gwt


    【解决方案1】:

    意思是:

    对传输保证为机密的 URL 使用 HTTP(非安全)的请求会使用 HTTPS 自动重定向到相同的 URL。

    所以对http://myapp.appspot.com/profile/%anything%的所有请求都会被重定向到https://myapp.appspot.com/profile/%anything%

    参见文档:https://cloud.google.com/appengine/docs/java/config/webxml#Secure_URLs

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-05-04
      • 1970-01-01
      • 1970-01-01
      • 2018-01-11
      • 1970-01-01
      • 2017-03-26
      • 2015-06-05
      • 2011-01-11
      相关资源
      最近更新 更多