root下运行JSP出错,TOmcat主页能显示,JDK配置成功了。很急··

来源:百度知道 编辑:UC知道 时间:2024/06/30 02:23:28
出错信息如下:
(大哥大姐们帮忙啦··帮我解决了问题就追加分··)

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

exception

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

No Java compiler was found to compile the generated source for the JSP.
This can usually be solved by copying manually $JAVA_HOME/lib/tools.jar from the JDK
to the common/lib directory of the Tomcat server, followed by a Tomcat restart.
If using an alternate Java compiler, please check its installation and access path.

org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:82)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:306)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:373)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:416)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:397

没有导入包,或者导入的包的路径不正确,或者你的java文件编译完成以后就没有拖放到WEB-INF/classes目录下边去
如果你导入cn.aa.kk这个包,那么你在classes目录下的class文件就放在子目录cn/aa/kk 下面。

jsp的第一句最好为<%@ page language="java" import="xx.xx.MyNameBean" %>
<jsp:useBean ....>写在后面

如果不是java的问题,那就没别的了