朋友,你们好,用j2sdk1.4.2和tomcat5.0在运行程序如下:
<html> <!-- Copyright (c) 1999 The Apache Software Foundation. All rights reserved. -->
<%@ page session="false"%>
<body bgcolor="white"> <jsp:useBean id='clock' scope='page' class='dates.JspCalendar' type="dates.JspCalendar" />
<font size=4> <ul> <li> Day of month: is <jsp:getProperty name="clock" property="dayOfMonth"/> <li> Year: is <jsp:getProperty name="clock" property="year"/> <li> Month: is <jsp:getProperty name="clock" property="month"/> <li> Time: is <jsp:getProperty name="clock" property="time"/> <li> Date: is <jsp:getProperty name="clock" property="date"/> <li> Day: is <jsp:getProperty name="clock" property="day"/> <li> Day Of Year: is <jsp:getProperty name="clock" property="dayOfYear"/> <li> Week Of Year: is <jsp:getProperty name="clock" property="weekOfYear"/> <li> era: is <jsp:getProperty name="clock" property="era"/> <li> DST Offset: is <jsp:getProperty name="clock" property="DSTOffset"/> <li> Zone Offset: is <jsp:getProperty name="clock" property="zoneOffset"/> </ul> </font>
</body> </html> 时,出现错误提示,
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: dates.JspCalendar org.apache.jasper.compiler.BeanRepository.getBeanType(BeanRepository.java:122) org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1050) org.apache.jasper.compiler.Node$GetProperty.accept(Node.java:1078) org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2156) org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2206) org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2212) org.apache.jasper.compiler.Node$Root.accept(Node.java:484) org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2156) org.apache.jasper.compiler.Generator.generate(Generator.java:3228) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:284) org.apache.jasper.compiler.Compiler.compile(Compiler.java:451) 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)
root cause
java.lang.ClassNotFoundException: dates.JspCalendar org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1365) org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1212) org.apache.jasper.compiler.BeanRepository.getBeanType(BeanRepository.java:120) org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1050) org.apache.jasper.compiler.Node$GetProperty.accept(Node.java:1078) org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2156) org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2206) org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2212) org.apache.jasper.compiler.Node$Root.accept(Node.java:484) org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2156) org.apache.jasper.compiler.Generator.generate(Generator.java:3228) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:284) org.apache.jasper.compiler.Compiler.compile(Compiler.java:451) 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.
上面程序即为,tomcat5.0中所带例子jsp-examples中的dates/data.jsp 问题出在其在例子中运行时成功,而在把它改名后放在root下时却不行了,请指教。
另:朋友,我是新手,但对jsp学习有强烈欲望,希望和你们成为朋友,以后共同探讨,我的QQ是113083867。
若在论坛中回复,请找发表者为wangguan的,回复。谢谢。