日期:2014-05-18  浏览次数:20717 次

关于Unable to compile class for JSP的问题
我有这样的代码:
<%@   page   contentType= "text/html;charset=gbk "%>

<%@   taglib   uri= "struts/html "   prefix= "html "   %>
<%@   taglib   uri= "struts/bean "   prefix= "bean "   %>
<%@   taglib   uri= "struts/logic "   prefix= "logic "   %>
<%@   page   import= "java.util.*,com.ts.* "%>
<title> <bean:message   key= "title "/> </title>

<table   border= "1 ">
<tr>
<td> 书名 </td>
<td> 作者 </td>
<td> 定价 </td>
</tr>
<logic:empty   name= "users ">
<tr> <td   colspan=6> 数据库无记录 </td> </tr>
</logic:empty>

<logic:notEmpty   name= "books ">
  <logic:iterate   name= "books "   type= "com.ts.BookVO "   scope= "request "   id= "book ">
<tr>
<td> <bean:write   name= "book "   property= "bookname "/> </td>
<td> <bean:write   name= "book "   property= "master "/> </td>
<td> <bean:write   name= "book "   property= "prise "/> </td>
<td> <a   href=userDel.do?id= <bean:write   name= "book "   property= "id "/> > 删除 </a> </td>
<td> <a   href=userUpdate.do?id= <bean:write   name= "book "   property= "id "/> > 修改 </a> </td>
</tr>
  </logic:iterate>
</logic:notEmpty>

</table>

只运行这个JSP就出现了这样的问题:
org.apache.jasper.JasperException:   Unable   to   compile   class   for   JSP
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:559)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)


root   cause  

java.io.FileNotFoundException:   no   such   file:   D:\Program   Files\Apache   Software   Foundation\Tomcat   5.0\work\Catalina\localhost\xtApp\org\apache\jsp\bookList_jsp.class
org.apache.jasper.compiler.SmapUtil$SDEInstaller. <init> (SmapUtil.java:237)
org.apache.jasper.compiler.SmapUtil$SDEInstaller.install(SmapUtil.java:225)
org.apache.jasper.compiler.SmapUtil.installSmap(SmapUtil.java:153)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:429)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:458)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:553)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248) <