本文主要是介绍Page directive: illegal to have multiple occurrences of contentType with different values (x,X)之解,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
Question:
Page directive: illegal to have multiple occurrences of contentType with different values
(old: text/html; charset=utf-8, new: text/html;charset=UTF-8)
Analysis:
出现这个的原因是这两个jsp的contentType设置不一致所导致的。
当一个JSP include 另一个JSP时contentType不一致的时候就会报这个错误。
案发现场当前JSP
<%@ page contentType="text/html;charset=utf-8" language="java" %>
被include的JSP<%@ page contentType="text/html;charset=UTF-8" language="java" %>
本次报错是因为UTF-8和utf-8所导致的。
Answer:
把当前的JSP和被引入的JSP的contentType设置一样就行。
都改成一样就OK了
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
这篇关于Page directive: illegal to have multiple occurrences of contentType with different values (x,X)之解的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!