• tomcat6.0添加ssi(*.shtml)配置


    1.去掉tomcat6中conf/web.xml关于ssi的注释

    <servlet>
            <servlet-name>ssi</servlet-name>
            <servlet-class>
              org.apache.catalina.ssi.SSIServlet
            </servlet-class>
            <init-param>
              <param-name>buffered</param-name>
              <param-value>1</param-value>
            </init-param>
            <init-param>
              <param-name>debug</param-name>
              <param-value>0</param-value>
            </init-param>
            <init-param>
              <param-name>expires</param-name>
              <param-value>666</param-value>
            </init-param>
            <init-param>
              <param-name>isVirtualWebappRelative</param-name>
              <param-value>0</param-value>
            </init-param>
            <load-on-startup>4</load-on-startup>
        </servlet>

    <servlet-mapping>
            <servlet-name>ssi</servlet-name>
            <url-pattern>*.shtml</url-pattern>
        </servlet-mapping>

    重启tomcat,如果出现exception:

    java.lang.SecurityException: Servlet of class org.apache.catalina.ssi.SSIServlet is privileged and cannot be loaded by this web application

    修改:tomcat6.0/conf/context.xml文件

    在标签<Context>里加入 privileged="true"
    变为:
    <Context privileged="true">

    如:tomcat6重启 以运行包含页面  但乱码; 修改tomcat6.0/conig/service.xml文件

    添加:

    <init-param> 
              <param-name>inputEncoding</param-name> 
              <param-value>utf-8</param-value>
            </init-param> 
            <init-param> 
              <param-name>outputEncoding</param-name> 
              <param-value>utf-8</param-value> 
    </init-param> 

    修改成:

        <servlet>
            <servlet-name>ssi</servlet-name>
            <servlet-class>
              org.apache.catalina.ssi.SSIServlet
            </servlet-class>
            <init-param>
              <param-name>buffered</param-name>
              <param-value>1</param-value>
            </init-param>
            <init-param>
              <param-name>debug</param-name>
              <param-value>0</param-value>
            </init-param>
            <init-param>
              <param-name>expires</param-name>
              <param-value>666</param-value>
            </init-param>
            <init-param>
              <param-name>isVirtualWebappRelative</param-name>
              <param-value>0</param-value>
            </init-param>
    <init-param> 
              <param-name>inputEncoding</param-name> 
              <param-value>utf-8</param-value>
            </init-param> 
            <init-param> 
              <param-name>outputEncoding</param-name> 
              <param-value>utf-8</param-value> 
            </init-param> 
            <load-on-startup>4</load-on-startup>
        </servlet>

    ok; .......

  • 相关阅读:
    HSTS详解
    cdnbest 节点和主控连接不上原因主要查看几点
    正则表达式30分钟入门教程
    cdn贝四层协议配置端口映射TCP端口转发
    关于HSTS安全协议的全面详细解析
    cdnbest配置强制ssl跳转
    THUWC2020游记
    2019 CSP-S Day2-T1 Emiya 家今天的饭(DP)
    网络流之费用流(最小费用最大流) 学习笔记
    网络流之最大流 学习笔记
  • 原文地址:https://www.cnblogs.com/andy-do/p/3248287.html
Copyright © 2020-2023  润新知