问jsp把汉字url编码的函数?(50分)

  • 主题发起人 主题发起人 ccniao
  • 开始时间 开始时间
C

ccniao

Unregistered / Unconfirmed
GUEST, unregistred user!
比如把"电"编码成%B5%E7
 
out.print(java.net.URLEncoder("电"));
 
response.encodeurl()
 
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 17 in the jsp file: /a/ftpsearch.jsp
Generated servlet error:
[javac] Compiling 1 source file
[javac] /var/tomcat4/work/Apache/xx.xx.xx.xx/ruder/a/ftpsearch_jsp.java:83: cannot resolve symbol
[javac] symbol : class net
[javac] location: package java
[javac] out.print(java.net.URLEncoder("鐢
[javac] ^
[javac] Note: /var/tomcat4/work/Apache/xx.xx.xx.xx/ruder/a/ftpsearch_jsp.java uses or overrides a deprecated API.
[javac] Note: Recompile with -deprecation for details.
[javac] 1 error

我是这个样子
out.print(java.net.URLEncoder("电"));
 
知道了
thanks!
 
嘿嘿,对不起,漏了 .encode(),不该得分。
 
后退
顶部