Page directive: illegal to have multiple occurrences of contentType with different values (old: text

来源:互联网 发布:java 字符串特殊符号 编辑:程序博客网 时间:2024/05/23 12:02

 情况是这样的:

 在一个jsp文件中包含另外一个jsp文件(比如:jsp头部和尾部文件)

有时候会出现以下错误:

严重: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /lightworkflow/sheet/depponOrder/proCitySelAll.jsp(1,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)
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:236)
at org.apache.jasper.compiler.Validator$DirectiveVisitor.visit(Validator.java:132)
at org.apache.jasper.compiler.Node$PageDirective.accept(Node.java:608)

原来是包含页面与被包含页面的@page指令里面的contentType不一致,仔细检查两个文件第一行的 @page,原因问题出在主jsp页面中的顶部字符编码和从jsp顶部字符编码格式有误,要统一,中间不需要空格之类,否则一直报错

0 0
原创粉丝点击