Add HSTS feature to Tomcat

前端 未结 4 1700
天涯浪人
天涯浪人 2021-02-02 01:06

Trust you all well.

My web application run on tomcat 6.0.43 and do not use apache or nginx at front.

I\'m already enforce my web from http redirect to https usi

4条回答
  •  既然无缘
    2021-02-02 02:07

    1. just add this code in jsp under jsp scriptlet tags

      <%
          response.setHeader("Strict-Transport-Security" ,"max-age=7776000" );
      %>
      

    OR

    1. Also can be add to server if JBoss then add below tags in web.xml of application

      
          
              
                  
              
          
      
      

      for You have to add xmlnsi other wise it will throw Parsing exception

    OR

    1. You can do one thing: create a filter in your application and configure that application in web.xml

提交回复
热议问题