当前位置: 代码迷 >> Java Web开发 >> UnsupportedEncodingException cannot be resolved to a type解决思路
  详细解决方案

UnsupportedEncodingException cannot be resolved to a type解决思路

热度:841   发布时间:2016-04-17 10:37:27.0
UnsupportedEncodingException cannot be resolved to a type
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: }


不清楚这个怎么改,各位帮帮忙吧。谢啦。


------解决方案--------------------
catch(UnsupportedEncodingException ee )直接改成catch(Exception ee)好了,或者打印出来看看是什么个情况
System.out.print(ee)
------解决方案--------------------
UnsupportedEncodingException cannot be resolved to a type


你没有引入UnsupportedEncodingException 这个类
------解决方案--------------------
因为你没有在JSP页面上将这个类导入进来:
<%@ page import="java.io.UnsupportedEncodingException" %> 
这样就可以了。
  相关解决方案