我装了TOMCAT5.0,而且JDK也配了。。我在地址拦输入http://127.0.0.1:8080/index.jsp
就出现了欢迎界面。但是我编了一个简单的jyx.jsp就出不来结果。为什么?
<html>
<title>123
</title>
<head>
</head>
<body>
<h3>hello,word</h3>
<body>
</html>
我在地址拦输入http://127.0.0.1:8080/jyx.jsp
下面这是错误代码,高手给看一下。。
HTTP Status 500 - --------------------------------------------------------------------------------type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this request.exception org.apache.jasper.JasperException: Unable to compile class for JSPNo 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:128)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:351)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:413)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:453)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:437)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:555)
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.
--------------------------------------------------------------------------------Apache Tomcat/5.0.12

解决方案 »

  1.   

    tomcat问题我不知道!不过你这个HTML代码是错了:
    <title>123
    </title>
    <head>
    </head>正确的是:<head>
              <title>123</title>
              </head>
      

  2.   

    <body>
    <h3>hello,word</h3>
    <body>正确的是:<body>
              <h3>hello,word</h3>
              </body>有点毛,没有一下子看完!在学动态网页制做前,先把静态的学好,HTML代码不能出错吧!不会走就跑不动!
      

  3.   

    安装tomcat时,需要选择jdk的安装路径,而不是用它默认的!!
    假设你的jdk的安装路径为d:\jdk
    那么在安装tomcat提示输入jdk路径时,只要将这个路径引入,就可以了!!因为tomcat的index.jsp是编译好的,已经有了.class文件所以可以打开!!
    而其他的jsp文件需要编译,这时,如果jdk路径不对,是不能成功被编译的!所以无法显示!!你可以试一下
      

  4.   

    你的这个是纯HTML的代码,如果只是这些的话就不要用.jsp的扩展名,用.htm就行了.
    如果做为Jsp文件的话开头应该加上:
    <@ page language="java" contentType="text/html;charset=gb2312"%>才行
    language="java" 可以不加.
      

  5.   

    哈哈!巧了!这个问题我今天刚遇到过,并且已经解决了.问题出在你的TOMCAT安装有问题,现在先卸载掉你的TOMCAT,重新安装.安装前确保你的JDK已经安装好并且环境变量配置好,然后再安装TOMCAT,记得安装过程中当提示你选择JDK的安装目录时选择好你已安装好的JDK的正确安装目录,然后问题就应该解决了!此问题是因为TOMCAT安装过程操作不当或环境变量配置问题导致的.
    收分喽!