Page-encoding specified in XML prolog (UTF-8) is different from that specified in page directive (utf-8)
将项目移植到myeclipse8后,访问页面是出现以上错误提示,查阅相关资料后,猜测可能是因为tomcat版本的原因(项目之前是使用的tomcat7,后来换成了tomcat6).WEB-INF下的web.xml文件中是UTF-8编码,而项目的jsp页面是使用的utf-8编码,将页面的utf-8改成UTF-8(有人觉得直接将web.xml文件中的UTF-8改为utf-8比改每一个页面的编码更快捷,但是我试了,似乎并不管用),有过滤器中含有utf-8的最好也改成UTF-8.
页面报的异常
Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /manager/login.jsp(1,1) Page-encoding specified in XML prolog (UTF-8) is different from that specified in page directive (utf-8)
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.