JSP 报的错,
org.apache.jasper.JasperException: /jsp/header.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
根据错误提示可以发现是出现了两种contentType 格式,分别是 text/html; charset=utf-8, 和 text/html; charset=UTF-8 虽然utf-8大小写都一样作用
但是在 <%@ include file=“XXX.jsp” %> 加载页面时会多次加载
<%@ page language=“java” contentType="text/html; charset=UTF-8"pageEncoding=“UTF-8”%>
所以只需要把charset,pageEncoding都改成utf-8 或者UTF-8就行了
大小写不一样的话,编译器会报异常,建议还是使用大写 UTF-8
org.apache.jasper.JasperException: /jsp/header.jsp (line: 1, column: 2) Page directive
最新推荐文章于 2020-08-06 10:16:43 发布