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

请大家帮我看一下我的jsp网页放在Webapps目录下为什么不能在网上访问?
我是这样设置的:
1、将我的jsp网页全部放在test文件夹里(里面有个index.jsp)。
2、将test文件夹拷贝到webapps下。
3、设置conf下的server.xml:
      <ContextManager>                  
              <Context   path= "/test "   docBase= "webapps/Test "/>
      </ContextManager>
    注意:我用的tomcat是5.0,在server.xml里没有contextmanager这一项,这里是我自己加上去的。不知道对不对?

设置完成后,我就在浏览器上输入:http://localhost:8080/test/index.jsp
出现下面的错误:
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   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:127)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:351)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:415)
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)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)


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

这下,我就不懂了,请大家帮我。


------解决方案--------------------
我的异常网推荐解决方案:java环境变量设置,http://www.aiyiweb.com/java-other/172921.html
------解决方案--------------------
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.

JAVA_HOME的环境变量设置了没有?
------解决方案--------------------
lz按下面这句话说的试试:
This can usually be solved by copying manually $JAVA_HOME/lib/tools.jar from the JDK