我装了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
就出现了欢迎界面。但是我编了一个简单的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
<title>123
</title>
<head>
</head>正确的是:<head>
<title>123</title>
</head>
<h3>hello,word</h3>
<body>正确的是:<body>
<h3>hello,word</h3>
</body>有点毛,没有一下子看完!在学动态网页制做前,先把静态的学好,HTML代码不能出错吧!不会走就跑不动!
假设你的jdk的安装路径为d:\jdk
那么在安装tomcat提示输入jdk路径时,只要将这个路径引入,就可以了!!因为tomcat的index.jsp是编译好的,已经有了.class文件所以可以打开!!
而其他的jsp文件需要编译,这时,如果jdk路径不对,是不能成功被编译的!所以无法显示!!你可以试一下
如果做为Jsp文件的话开头应该加上:
<@ page language="java" contentType="text/html;charset=gb2312"%>才行
language="java" 可以不加.
收分喽!