当前位置: 代码迷 >> Java Web开发 >> org.apache.jasper.JasperException: Unable to load class for JSP
  详细解决方案

org.apache.jasper.JasperException: Unable to load class for JSP

热度:43   发布时间:2016-04-17 15:08:27.0
手机号码隐藏中间四位的问题!在线等,谢谢各位!
从数据库得到号码:pcode=rs.getString( "Phone ");
之后应该如何处理能显示的时候隐去中间四位啊?
谢谢大家啦!

------解决方案--------------------
pcode=rs.getString( "Phone ");
pcode=pcode.substring(0,3)+ '**** '+pcode.substring(7);

pcode= '13912345678 ';
pcode=pcode.substring(0,3)+ '**** '+pcode.substring(7);

139****5678
------解决方案--------------------
theforever(碧海情天)解释的很清楚了怎么还提帖子?
------解决方案--------------------
pcode=rs.getString( "Phone ");
pcode=pcode.replaceAll(pcode.subString(3,4), "**** ");
------解决方案--------------------
theforever(碧海情天) 回答的很清楚了
------解决方案--------------------
lhfzd2004(风之刀) 的这个方法不错。
pcode=rs.getString( "Phone ");
pcode=pcode.replaceAll(pcode.subString(3,4), "**** ");

------解决方案--------------------
我该了代码,如下:
while(rs.next()){
pcode=rs.getString( "Phone ");
pcode=pcode.substring(0,3)+ '**** '+pcode.substring(7);
src=src+pcode+ ", ";

}
但是报错啦:
HTTP Status 500 -

--------------------------------------------

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Unable to load class for JSP
org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:598)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:137)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause

java.lang.ClassNotFoundException: org.apache.jsp.ly365.cj1_jsp
java.net.URLClassLoader$1.run(URLClassLoader.java:200)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(URLClassLoader.java:188)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:133)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:65)
org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:596)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:137)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


note The full stack trace of the root cause is available in the Apache Tomcat/5.5.12 logs.

这是什么原因啊?
------解决方案--------------------
找不到jsp编译后的类,
建议把cj1.jsp随便改动下让Tomcat重新加载,
或者清空Tomcat主目录\work\Catalina\localhost\项目文件夹\org\apache\jsp\ly365\
------解决方案--------------------
subString

classNotFound跟本问题无关
------解决方案--------------------
标记!
------解决方案--------------------
  相关解决方案