请教:为什么出现错误java.io.UnsupportedEncodingException: gbk

IvanGan 2004-09-14 09:46:38
我的tomcat下的jsp出现如下错误java.io.UnsupportedEncodingException: gbk,请教是为什么

org.apache.jasper.JasperException: gbk
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:575)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:498)
at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:822)
at org.apache.jsp.todoList_jsp._jspService(todoList_jsp.java:103)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Thread.java:536)


root cause

java.io.UnsupportedEncodingException: gbk
at sun.io.Converters.getConverterClass(Converters.java:114)
at sun.io.Converters.newConverter(Converters.java:145)
at sun.io.ByteToCharConverter.getConverter(ByteToCharConverter.java:64)
at java.lang.StringCoding.decode(StringCoding.java:216)
at java.lang.String.(String.java:331)
at java.lang.String.(String.java:359)
at org.apache.jsp.location_jsp._jspService(location_jsp.java:42)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
...全文
2169 9 1 打赏 收藏 举报
写回复
9 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
baseuser 2010-05-29
估计你是写了resp.setCharacterencoding("gbk");
换成resp.setContentType("text/html;charset=GBK");
  • 打赏
  • 举报
回复
baseuser 2010-05-29
急的话联系我qq。79993563
  • 打赏
  • 举报
回复
baseuser 2010-05-29
代码发上来。
  • 打赏
  • 举报
回复
IvanGan 2004-09-20
问题的原因是在jsp中的"gbk"用了小写,改用大写"GBK"就ok了
  • 打赏
  • 举报
回复
redlaputa 2004-09-16
不支持输出gbk
重装试试
  • 打赏
  • 举报
回复
IvanGan 2004-09-16
有谁遇到过吗
  • 打赏
  • 举报
回复
popufig 2004-09-15
不支持GBK编码?没碰到过这样的...
  • 打赏
  • 举报
回复
IvanGan 2004-09-15
??
  • 打赏
  • 举报
回复
IvanGan 2004-09-14
有没有哪位大侠遇到过这样的情况啊?
  • 打赏
  • 举报
回复
相关推荐
发帖
Web 开发
创建于2007-09-28

8.0w+

社区成员

Java Web 开发
申请成为版主
帖子事件
创建了帖子
2004-09-14 09:46
社区公告
暂无公告