Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Servlet/JSP/JSF/JavaFX Script  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
reply to postflat modethreaded modego to previous topicgo to next topicgo to back
作者 按斑竹的配置,第一个jsp,同样难产-问题解决了,是安装tomcat有点问题
yingzhe





发贴: 6
于 2005-11-08 09:30 user profilesend a private message to userreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
安装好jdk,配置后测试java程序没问题
安装好tomcat,配置后运行:htpp://localhost:8080,可以出现欢迎界面
tomcat自带的jsp-example运行正常。
建立自己的jsp app目录
1.到Tomcat的安装目录的webapps目录,可以看到ROOT,examples, tomcat-docs之类Tomcat自带的的目录;
2.在webapps目录下新建一个目录,起名叫myapp;
3.myapp下新建一个目录WEB-INF,注意,目录名称是区分大小写的;
4.WEB-INF下新建一个文件web.xml,内容如下:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!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>My Web Application</display-name>
<description>
A application for test.
</description>
</web-app>
5.在myapp下新建一个测试的jsp页面,文件名为index.jsp,文件内容如下:
<html><body><center>
Now time is: <%=new java.util.Date()%>
</center></body></html>
6.重启Tomcat
7.打开浏览器,输入http://localhost:8080/myapp/index.jsp
出现一下错误:
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:439)
  org.apache.jasper.compiler.Compiler.compile(Compiler.java:497)
  org.apache.jasper.compiler.Compiler.compile(Compiler.java:476)
  org.apache.jasper.compiler.Compiler.compile(Compiler.java:464)
  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:105)
  org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:929)
  org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:758)
  org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:407)
  org.apache.jasper.compiler.Compiler.compile(Compiler.java:497)
  org.apache.jasper.compiler.Compiler.compile(Compiler.java:476)
  org.apache.jasper.compiler.Compiler.compile(Compiler.java:464)
  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.30 logs.

本站点关于tomcat配置的帖子我也都看了,可还是解决不了当前问题,不知道小弟有哪些发面没有注意到,请各位高手多多指教,不胜感激!!


YuLimin edited on 2005-11-16 12:18

酒后论天下英雄,叹无伯乐识君;更难堪,红颜无福,竟入他人怀!

从Coding Fan到真正的技术专家

话题树型展开
人气 标题 作者 字数 发贴时间
2889 按斑竹的配置,第一个jsp,同样难产-问题解决了,是安装tomcat有点问题 yingzhe 3381 2005-11-08 09:30
2358 Re:按斑竹的配置,第一个jsp,同样难产 leowu2000 38 2005-11-08 13:33
2453 Re:按斑竹的配置,第一个jsp,同样难产 yingzhe 64 2005-11-08 23:55
2361 Re:按斑竹的配置,第一个jsp,同样难产 leowu2000 82 2005-11-09 00:48
2428 Re:按斑竹的配置,第一个jsp,同样难产 chengbd 78 2005-11-12 04:17
2420 Re:按斑竹的配置,第一个jsp,同样难产 zhupan 329 2005-11-12 15:17
2470 Re:按斑竹的配置,第一个jsp,同样难产 yingzhe 32 2005-11-16 12:12

reply to postflat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923