UnsupportedEncodingException cannot be resolved to a type

wkupaochuan 2012-03-12 12:53:57
An error occurred at line: 31 in the jsp file: /JSP/RegisterSuccess.jsp
UnsupportedEncodingException cannot be resolved to a type
28: byte b[]=s.getBytes("ISO-8859-1");
29: return (new String(b,"utf-8"));
30: }
31: catch(UnsupportedEncodingException ee )
32: {
33: return "缂栫爜杞崲閿欒:"+ee.getMessage();
34: }


不清楚这个怎么改,各位帮帮忙吧。谢啦。
...全文
431 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
「已注销」 2012-03-12
  • 打赏
  • 举报
回复
谢啦。[Quote=引用 3 楼 dryzeng 的回复:]

UnsupportedEncodingException cannot be resolved to a type


你没有引入UnsupportedEncodingException 这个类
[/Quote]
「已注销」 2012-03-12
  • 打赏
  • 举报
回复
明白了。谢啦。[Quote=引用 2 楼 wkupaochuan 的回复:]

很管用,但是不知道什么原因啊。我看网上有几个例子都是用的UnsupportedEncodingException。
[/Quote]
im110 2012-03-12
  • 打赏
  • 举报
回复
因为你没有在JSP页面上将这个类导入进来:
<%@ page import="java.io.UnsupportedEncodingException" %>
这样就可以了。
dryZeng 2012-03-12
  • 打赏
  • 举报
回复
UnsupportedEncodingException cannot be resolved to a type


你没有引入UnsupportedEncodingException 这个类
「已注销」 2012-03-12
  • 打赏
  • 举报
回复
很管用,但是不知道什么原因啊。我看网上有几个例子都是用的UnsupportedEncodingException。
zwp441288971 2012-03-12
  • 打赏
  • 举报
回复
catch(UnsupportedEncodingException ee )直接改成catch(Exception ee)好了,或者打印出来看看是什么个情况
System.out.print(ee)

81,094

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧