illegal to have multiple occurrences of contentTyp

jsp1的第一行:html

<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false"%>java

jsp2的第一行jsp

<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" isELIgnored="false"%>htm

在jsp1中includejsp2,就會致使illegal to have multiple occurrences of 'contentType' with different values (old: text/html; charset=ISO-8859-1, new: text/html; charset=utf-8)報錯,ip

注意查看兩個文件的第一行,發現jsp2的contentType="text/html; charset=utf-8"中charset前多了一個空格,刪掉此空格。而且jsp2中的UTF-8爲大寫,改爲小寫,嚴格保持jsp一、jsp2兩個文件一致,報錯解決。utf-8

相關文章
相關標籤/搜索