【发布时间】:2014-10-02 18:26:49
【问题描述】:
我正在使用 Servlet 3.x 开发 Web 应用程序,但我没有 web.xml,而是使用配置注释。我想将部署在 Openshift 中的应用程序的所有流量限制为 HTTPS。我发现这篇关于如何在 Tomcat(Jboss EWS)中做到这一点的文章。
https://help.openshift.com/hc/en-us/articles/202398810-How-to-redirect-traffic-to-HTTPS-
但是最后一步涉及我更改我没有的 web.xml。当我试图寻找替代方案时,我可以找到有关 Servlet 安全性的文章。有人可以帮我翻译下面这段代码sn-p吗?
A sample security-constraint directive in repo/src/main/webapp/WEB-INF/web.xml looks like:
<security-constraint>
<web-resource-collection>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
【问题讨论】:
标签: java spring servlets openshift