JSP页面中出现了Page directive: illegal to have multiple occurrences of contentType with different values异常

页面具体是这样报错的

HTTP Status 500 - /inc/common_head.jsp (line: 1, column: 2) Page directive: illegal to have multiple occurrences of contentType with different values (old: text/html;charset=UTF-8, new: text/html; charset=UTF-8)

type Exception report

message /inc/common_head.jsp (line: 1, column: 2) Page directive: illegal to have multiple occurrences of contentType with different values (old: text/html;charset=UTF-8, new: text/html; charset=UTF-8)

description The server encountered an internal error that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: /inc/common_head.jsp (line: 1, column: 2) Page directive: illegal to have multiple occurrences of contentType with different values (old: text/html;charset=UTF-8, new: text/html; charset=UTF-8)

页面代码没错,我口头翻译了一下illegal to have multiple occurrences of contentType with different values,是包含页面和被包含页面的contentType设置不一样

包含页面原来的page指令是这样的

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

被包含页面原来的page指令是这样的

<%@ page contentType="text/html; charset=UTF-8"%>

我把被包含页面,也就是我异常中提示的/inc/common_head.jsp页面中的page指令重新改成了包含页面中的page指令,就解决了

猜你喜欢

转载自blog.csdn.net/qsw2lw/article/details/84300850