其他分享
首页 > 其他分享> > apache 9.0发布web工程页面乱码解决

apache 9.0发布web工程页面乱码解决

作者:互联网

打开conf目录下的web.xml,找到如下配置

<servlet>
    <servlet-name>default</servlet-name>
    <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
    <init-param>
        <param-name>debug</param-name>
        <param-value>0</param-value>
    </init-param>
    <init-param>
        <param-name>listings</param-name>
        <param-value>false</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
</servlet>

增加配置

<init-param>
  <param-name>fileEncoding</param-name>
  <param-value>UTF-8</param-value>
</init-param>

最终配置

<servlet>
    <servlet-name>default</servlet-name>
    <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
    <init-param>
        <param-name>debug</param-name>
        <param-value>0</param-value>
    </init-param>
    <init-param>
        <param-name>fileEncoding</param-name>
        <param-value>UTF-8</param-value>
    </init-param>
    <init-param>
        <param-name>listings</param-name>
        <param-value>false</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
</servlet>

标签:web,catalina,false,servlets,乱码,apache,UTF
来源: https://www.cnblogs.com/windsnow/p/15262580.html