主题:服务器配好后可以浏览默认主业,但……
jdk1.3.1+tomcat4.0配好后输入http://localhost:8080可以看到大猫
但试着运行一下代码时报错
<%@ page contentType="text/html;charset=GB2312"%>
<% page import="java.util.*"%>
<HTML>
<BODY>
<P>现在的时间是:
<% Data date=new Data();
%>
<BR>
<%=data%>
</BODY>
</HTML>
在地址栏输入http://localhost:8080/example.jsp错误报告如下
type Exception report
message Internal Server Error
description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 2 in the jsp file: /example.jsp
Generated servlet error:
E:jakarta-tomcat-4.0.1worklocalhost_example$jsp.java:58: Invalid expression statement.
page import="java.util.*"
^
An error occurred at line: 2 in the jsp file: /example.jsp
Generated servlet error:
E:jakarta-tomcat-4.0.1worklocalhost_example$jsp.java:58: ';' expected.
page import="java.util.*"
^
2 errors
但试着运行一下代码时报错
<%@ page contentType="text/html;charset=GB2312"%>
<% page import="java.util.*"%>
<HTML>
<BODY>
<P>现在的时间是:
<% Data date=new Data();
%>
<BR>
<%=data%>
</BODY>
</HTML>
在地址栏输入http://localhost:8080/example.jsp错误报告如下
type Exception report
message Internal Server Error
description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 2 in the jsp file: /example.jsp
Generated servlet error:
E:jakarta-tomcat-4.0.1worklocalhost_example$jsp.java:58: Invalid expression statement.
page import="java.util.*"
^
An error occurred at line: 2 in the jsp file: /example.jsp
Generated servlet error:
E:jakarta-tomcat-4.0.1worklocalhost_example$jsp.java:58: ';' expected.
page import="java.util.*"
^
2 errors