本文共 1541 字,大约阅读时间需要 5 分钟。
Page directive: illegal to have multiple occurrences of contentType with different values (old: text/html; charset=utf-8, new: text/html; charset=UTF-8) at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:41) at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:275) at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:107) at org.apache.jasper.compiler.Validator$DirectiveVisitor.visit(Validator.java:135) at org.apache.jasper.compiler.Node$PageDirective.accept(Node.java:571) at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376) at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2428) at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2434) at org.apache.jasper.compiler.Node$Root.accept(Node.java:464) at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376) at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2428) at org.apache.jasper.compiler.Validator$DirectiveVisitor.visit(Validator.java:101) at org.apache.jasper.compiler.Node$IncludeDirective.accept(Node.java:635) at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376) at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2428) at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2434) at org.apache.jasper.compiler.Node$Root.accept(Node.java:464)
首先看下此两个页面中page指令
<%@ page contentType="text/html; charset=UTF-8" language="java" %>
charset=UTF-8 字符集是否不同。大小写不同也会报错。所以保持统一。两个页面的字符集设置成一模一样。要么同时大写要么同时小写
转载地址:http://hlvbi.baihongyu.com/