日期:2014-05-18  浏览次数:20762 次

出错!!
java.io.UTFDataFormatException:   Invalid   byte   2   of   2-byte   UTF-8   sequence.
org.apache.jasper.xmlparser.UTF8Reader.invalidByte(UTF8Reader.java:621)
org.apache.jasper.xmlparser.UTF8Reader.read(UTF8Reader.java:310)
org.apache.jasper.xmlparser.XMLEncodingDetector.load(XMLEncodingDetector.java:1000)
org.apache.jasper.xmlparser.XMLEncodingDetector.skipString(XMLEncodingDetector.java:951)
org.apache.jasper.xmlparser.XMLEncodingDetector.scanXMLDecl(XMLEncodingDetector.java:1209)
org.apache.jasper.xmlparser.XMLEncodingDetector.getEncoding(XMLEncodingDetector.java:121)
org.apache.jasper.xmlparser.XMLEncodingDetector.getEncoding(XMLEncodingDetector.java:109)
org.apache.jasper.compiler.ParserController.determineSyntaxAndEncoding(ParserController.java:305)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:170)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:156)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:296)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:299)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
com.mgj.user.servlet.UserServlet.doPost(UserServlet.java:50)
javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)



------解决方案--------------------
路过~~
把xml文件里的encoding= 'UTF-8 '改为 encoding= 'GB2312 '试试
------解决方案--------------------
在读的时候一定要设定编码方式,且要和文件编码方式匹配!