美文网首页
jsp include html 中文乱码

jsp include html 中文乱码

作者: 斐硕人 | 来源:发表于2016-12-09 14:10 被阅读0次

    问题

    使用了两种引用方式
    第一种无乱码

    <%@ include file="header.htmlf" %> 
    

    第二种乱码

    <jsp:include page="header.htmlf" flush="true"/>
    

    解决

    web.xml文件中添加

    <jsp-config>
        <jsp-property-group>
        <description>html encoding example</description>
        <display-name>JSPConfiguration</display-name>
        <url-pattern>*.htmlf</url-pattern>
        <el-ignored>true</el-ignored>
        <page-encoding>UTF-8</page-encoding>
        <scripting-invalid>false</scripting-invalid>
        <include-prelude></include-prelude>
        <include-coda></include-coda>
        </jsp-property-group>
    </jsp-config>
    

    相关文章

      网友评论

          本文标题:jsp include html 中文乱码

          本文链接:https://www.haomeiwen.com/subject/jxbemttx.html