相关疑难解决方法(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万
查看次数

如何在Java中获取Tomcat版本号

如何在JAVA中获取Tomcat/Catalina版本号?

我已经看到很多如何通过命令行等来做到这一点,但这不是我可以使用的代码,我也不能使用catalina.path,因为版本号已从路径中删除.

还请注意我想在代码中使用该版本,因此我所看到的各种JSP解决方案对我来说也不起作用.

谢谢

java tomcat version

4
推荐指数
1
解决办法
3280
查看次数

Tomcat6和JRE7的兼容性问题.不支持的major.minor版本51.0

我有一个用JRE7编译的Web应用程序,现在我想在Tomcat6上运行它.当我启动我的应用程序时,我在日志中看到异常:

Unsupported major.minor version 51.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) 
Run Code Online (Sandbox Code Playgroud)

此异常来自实现ServletContextListener的类.

这是否意味着我必须将Tomcat7用于使用JRE7编译的代码?有解决方法吗?任何信息都是有价值的.

java tomcat tomcat6

1
推荐指数
1
解决办法
3037
查看次数

标签 统计

java ×3

tomcat ×3

hsts ×1

security ×1

spring ×1

tomcat6 ×1

version ×1