tomcat 提示Unable to compile class for JSP

[复制链接]
查看11 | 回复4 | 2010-7-14 09:37:06 | 显示全部楼层 |阅读模式
小弟我刚刚接触jsp 按书上的调试 好像只要出现import **
就会提示Unable to compile class for JSP
希望指教一下
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 4 in the jsp file: /test/date.jsp
Syntax error, insert ";" to complete LocalVariableDeclarationStatement
1:
3:
6: [tr]
7: [td]*当前日期[/td]
An error occurred at line: 8 in the jsp file: /test/date.jsp
Syntax error, insert ";" to complete Statement
5: SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); %>
6: [tr]
7: [td]*当前日期[/td]
8: [td][/td]
9: [/tr]

我是按照书上代码敲的是不是 “类”哪儿出错的原因

回复

使用道具 举报

千问 | 2010-7-14 09:37:06 | 显示全部楼层
是不是Jdk的版本不合适啊Windows->Preferences->Java->CompilerWindows->Preferences->MyEclipse Enterprise Workbench->Servers->Tomcat->Tomcat 6.x->JDK ==================================================================An error occurred at line: 4 in the jsp fileinsert ";"
回复

使用道具 举报

千问 | 2010-7-14 09:37:06 | 显示全部楼层
有地方语法不对. 把java代码copy到某个.java文件中,mycelipse会有提示
回复

使用道具 举报

千问 | 2010-7-14 09:37:06 | 显示全部楼层
JSP页面头部使用如下格式:
回复

使用道具 举报

千问 | 2010-7-14 09:37:06 | 显示全部楼层
在第四行代码后面加“;” 改后如下:Date date=new Date();
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行