初学者,进者有分,高手帮忙测试的显示问题。

sunboby 2004-10-26 12:01:15
我装的j2sdk1.4.2_06+Tomcat 5.0来做jsp
安装目录为C:\Tomcat 5.0 和C:\j2sdk1.4.2_06
我的.java的程序能编译通过,http://localhost:8080测试也能正长显示
以下是我的环境变量
CLASSPATH %JAVA_HOME%\lib;%TOMCAT_HOME%\lib;C:\Tomcat 5.0\common\lib\servlet- api.jar;.;C:\j2sdk1.4.2_06\lib\dt.jar;C:\j2sdk1.4.2_06\lib\tools.jar
JAVA_HOME C:\j2sdk1.4.2_06
PATH %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;C:\j2sdk1.4.2_06\bin;C:\Tomcat 5.0\bin
TOMCAT_HOME C:\Tomcat 5.0
我把我做的jsp文件放到了C:\Tomcat 5.0\webapps\myweb 文件夹下了。也建了WEB-INF文件夹里面有web.xml文件
为什么我访问http://localhost:8080/myweb/test.jsp时出错呢。

高手帮我看看。解决马上给分
...全文
149 点赞 收藏 19
写回复
19 条回复
切换为时间正序
请发表友善的回复…
发表回复
sunboby 2004-10-30
问题解决了。我又从装了tomcat
回复
bluesky35 2004-10-27
JAVA_HOME没有设好,要指向JDK目录.
回复
bp69 2004-10-27
帮顶混分
回复
sunboby 2004-10-27
高手近来帮帮我
回复
sunboby 2004-10-27
帮忙啊
回复
lijunjiejava 2004-10-26
<app-dir>doc</app-dir>

改成
<app-dir>C:\Tomcat 5.0\webapps\myweb</app-dir>
回复
monkeyhjl 2004-10-26
配置C:\Tomcat 5.0\conf下的server.xml文件。
<Context path="/myweb" docBase="C:\Tomcat 5.0\webapps\myweb" debug="0" reloadable="true">
</Context>
回复
sunboby 2004-10-26
这是test.jsp测试文件
<HTML>
<HEAD>
<TITLE>JSP测试页面</TITLE>
</HEAD>
<BODY>
<%out.println("<h1>Hello World! </h1>");%>
</BODY>
</HTML>
回复
sunboby 2004-10-26
这是web.xml文件
<web-app>
<servlet>
<servlet-name>ConfigServlet</servlet-name>
<servlet-class>ConfigServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>ConfigServlet</servlet-name>
<url-pattern>/servlet/ConfigServlet</url-pattern>
</servlet-mapping>
</web-app>
回复
debug148 2004-10-26
ding
回复
sunboby 2004-10-26
to 回复人: zlsunnan(明剑) ( ) 信誉:100
我把 web.xml改了也是不行还是上边的错误
回复
sunboby 2004-10-26
这是错误
HTTP Status 500 -

--------------------------------------------------------------------------------

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
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:97)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:346)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:414)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause

Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK
org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory.getCompiler(CompilerAdapterFactory.java:106)
org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:935)
org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:764)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:382)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


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


--------------------------------------------------------------------------------

Apache Tomcat/5.0.28
回复
hai3qing 2004-10-26
我配置的时候classpath,path都是.;在前.
只是在webapps下添加一个目录test,在里面键个WEB-INF,web.xml,重起tomcat,我就能访问http://localhost;8080/test
回复
zlsunnan 2004-10-26
应该是web.xml的错误
给出例子
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>fiyuForum WebApp</display-name>
<description>MyVietnam fiyuForum Web Application</description>
<servlet>
<servlet-name>ForumAdminServlet</servlet-name>
<servlet-class>fiyuforum.admin.ForumAdminServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>ForumUserServlet</servlet-name>
<servlet-class>fiyuforum.user.ForumUserServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ForumUserServlet</servlet-name>
<url-pattern>/forum/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ForumAdminServlet</servlet-name>
<url-pattern>/admin/*</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>120</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<taglib>
<taglib-uri>
http://jsptags.com/tags/navigation/pager
</taglib-uri>
<taglib-location>
/WEB-INF/pager-taglib.tld
</taglib-location>
</taglib>
</web-app>
回复
liumt88 2004-10-26
404还是500错误?
回复
bluesky35 2004-10-26
把错误贴出来看看
回复
sunboby 2004-10-26
怎么没人来啊。
分不够我可以再给的
回复
sunboby 2004-10-26
to monkeyhjl(爬上墙头等红杏) ( )
我写上了也不可以
是怎么回事啊
大家帮忙好不好
已经郁闷好几天了
回复
sunboby 2004-10-26
大家帮忙
回复
发动态
发帖子
Web 开发
创建于2007-09-28

7.9w+

社区成员

Java Web 开发
申请成为版主
社区公告
暂无公告