illegal to have multiple occurrences of contentTyp

jsp1的第一行:

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

jsp2的第一行

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

在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)报错,

注意查看两个文件的第一行,发现jsp2的contentType="text/html; charset=utf-8"中charset前多了一个空格,删掉此空格。并且jsp2中的UTF-8为大写,改成小写,严格保持jsp1、jsp2两个文件一致,报错解决。


你可能感兴趣的:(illegal to have multiple occurrences of contentTyp)