tomcat Page-encoding specified in XML prolog (UTF-8) is different from that spec

  Tomcat 6在启动时,jsp页面报告,页面显示无法,控制台中显示错误如下:

 

12:32:16,946 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /dialog.jsp(2,0) Page-encoding specified in XML 
prolog (UTF-8) is different from that specified in page directive (utf-8)

   

  网上检索大部分给出的建议是:下述配置pageEncoding="utf-8"中的utf-8应该为UTF-8

<%@ page language="java" import="java.util.*" contentType="text/html; 
charset=utf-8" pageEncoding="utf-8"%>

   不过,同样的工程,只有一台机器有如此错误。google结果推测可能是tomcat导致的。经过和同事电脑上tomcat中jasper.jar的对比发现,确实如google中说的一致。tomcat不同版本中comparePageEncodings方法实现不同所致。经过对上述jar替换之后,上述问题不在出现。

  据此猜想tomcat也存在版本的稳定问题。

 

你可能感兴趣的:(tomcat Page-encoding specified in XML prolog (UTF-8) is different from that spec)