日期:2014-05-17  浏览次数:20819 次

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" %> 
这样就可以了。