相关疑难解决方法(0)

将HSTS功能添加到Tomcat

相信你们.

我的Web应用程序在tomcat 6.0.43上运行,并且不在前面使用apache或nginx.

我已经通过http重定向强制我的网站使用:

  1. URL重定向位于../webapps/ROOT/index.jsp

<% response.sendRedirect("https://www.epi.com.my/portal/"); %>

  1. ../webapps/myapp/WEB-INF/web.xml
<security-constraint>
<web-resource-collection>
  <web-resource-name>Protected Context</web-resource-name>
     <url-pattern>/*</url-pattern>
 </web-resource-collection>
 <user-data-constraint>
    <transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint></security-constraint>
Run Code Online (Sandbox Code Playgroud)

在哪里添加此类代码

标题添加Strict-Transport-Security"max-age = 15768000"

或者tomcat没有这个功能吗?或者我需要修改我的每个Java Web应用程序控制器.

java security spring tomcat hsts

9
推荐指数
2
解决办法
2万
查看次数

标签 统计

hsts ×1

java ×1

security ×1

spring ×1

tomcat ×1