回 帖 发 新 帖 刷新版面

主题:服务器配好后可以浏览默认主业,但……

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

回复列表 (共1个回复)

沙发

对着比一下这俩句话
<%@ page contentType="text/html;charset=GB2312"%>
<% page import="java.util.*"%>

少了一个@朋友,做东西不要急,慢功出细活

我来回复

您尚未登录,请登录后再回复。点此登录或注册