“时间显示”程序运行问题请教
大家好,本人在运行如下程序
<%@ page import="java.unti.Date"%> <html> <head> <title> 测试jsp </title> <body> <center> 当前时间为: <%=new Date().toString()%> </center> </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: Unable to compile class for JSP
An error occurred at line: 10 in the jsp file: /shijian3.jsp
Generated servlet error:
[javac] Compiling 1 source file
D:\Tomcat 5.0\work\Catalina\localhost\_\org\apache\jsp\shijian3_jsp.java:6: package java.unti does not exist
import java.unti.Date;
^
D:\Tomcat 5.0\work\Catalina\localhost\_\org\apache\jsp\shijian3_jsp.java:48: cannot resolve symbol
symbol : class Date
location: class org.apache.jsp.shijian3_jsp
out.print(new Date().toString());
^
2 errors
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.






