几个错误帮忙卡下呗

zwb521 2010-10-22 09:54:50
org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 12 in the jsp file: /abcd.jsp
Calendar cannot be resolved to a type
9: String ls_lasttime="";
10: String ls_now="";
11: String content="";
12: Calendar cal=Calendar.getInstance();
13: ls_now=cal.get(Calendar.DAY_OF_MONTH);
14:
15: String cantwrite="";


An error occurred at line: 12 in the jsp file: /abcd.jsp
Calendar cannot be resolved
9: String ls_lasttime="";
10: String ls_now="";
11: String content="";
12: Calendar cal=Calendar.getInstance();
13: ls_now=cal.get(Calendar.DAY_OF_MONTH);
14:
15: String cantwrite="";


An error occurred at line: 13 in the jsp file: /abcd.jsp
Calendar.DAY_OF_MONTH cannot be resolved to a type
10: String ls_now="";
11: String content="";
12: Calendar cal=Calendar.getInstance();
13: ls_now=cal.get(Calendar.DAY_OF_MONTH);
14:
15: String cantwrite="";
16: String filename = request.getRealPath(lsfn_time);


An error occurred at line: 24 in the jsp file: /abcd.jsp
IOException cannot be resolved to a type
21: {
22: f.createNewFile();
23: }
24: catch(IOException e)
25: {
26: cantwrite="y";
27: }


An error occurred at line: 41 in the jsp file: /abcd.jsp
The operator || is undefined for the argument type(s) boolean, String
38: fr.close();
39: }
40:
41: if(ls_lasttime!=ls_now || request.getParameter("lsreload"))
42: {
43: try
44: {


An error occurred at line: 45 in the jsp file: /abcd.jsp
PrintWriter cannot be resolved to a type
42: {
43: try
44: {
45: PrintWriter pw = new PrintWriter(new FileOutputStream(filename));
46: pw.println(ls_now);
47: pw.close();
48: }


An error occurred at line: 45 in the jsp file: /abcd.jsp
PrintWriter cannot be resolved to a type
42: {
43: try
44: {
45: PrintWriter pw = new PrintWriter(new FileOutputStream(filename));
46: pw.println(ls_now);
47: pw.close();
48: }


An error occurred at line: 45 in the jsp file: /abcd.jsp
FileOutputStream cannot be resolved to a type
42: {
43: try
44: {
45: PrintWriter pw = new PrintWriter(new FileOutputStream(filename));
46: pw.println(ls_now);
47: pw.close();
48: }


An error occurred at line: 49 in the jsp file: /abcd.jsp
IOException cannot be resolved to a type
46: pw.println(ls_now);
47: pw.close();
48: }
49: catch(IOException e)
50: {
51: cantwrite="y";
52: content="error writing file.";


An error occurred at line: 71 in the jsp file: /abcd.jsp
Duplicate local variable filename
68:
69: if(cantwrite!="y")
70: {
71: String filename = request.getRealPath(lsfn_content);
72: java.io.File f = new java.io.File(filename);
73: if(!f.exists())
74: {


An error occurred at line: 72 in the jsp file: /abcd.jsp
Duplicate local variable f
69: if(cantwrite!="y")
70: {
71: String filename = request.getRealPath(lsfn_content);
72: java.io.File f = new java.io.File(filename);
73: if(!f.exists())
74: {
75: try


An error occurred at line: 79 in the jsp file: /abcd.jsp
IOException cannot be resolved to a type
76: {
77: f.createNewFile();
78: }
79: catch(IOException e)
80: {
81: cantwrite="y";
82: }


An error occurred at line: 86 in the jsp file: /abcd.jsp
PrintWriter cannot be resolved to a type
83: }
84: try
85: {
86: PrintWriter pw = new PrintWriter(new FileOutputStream(filename));
87: pw.println(content);
88: pw.close();
89: }


An error occurred at line: 86 in the jsp file: /abcd.jsp
PrintWriter cannot be resolved to a type
83: }
84: try
85: {
86: PrintWriter pw = new PrintWriter(new FileOutputStream(filename));
87: pw.println(content);
88: pw.close();
89: }


An error occurred at line: 86 in the jsp file: /abcd.jsp
FileOutputStream cannot be resolved to a type
83: }
84: try
85: {
86: PrintWriter pw = new PrintWriter(new FileOutputStream(filename));
87: pw.println(content);
88: pw.close();
89: }


An error occurred at line: 90 in the jsp file: /abcd.jsp
IOException cannot be resolved to a type
87: pw.println(content);
88: pw.close();
89: }
90: catch(IOException e)
91: {
92: cantwrite="y";
93: }

...全文
151 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
renjianguokeivor 2010-10-22
  • 打赏
  • 举报
回复
错误信息里都说的很清楚了
zwb521 2010-10-22
  • 打赏
  • 举报
回复
您有关于包引用讲解么
霜之哀伤 2010-10-22
  • 打赏
  • 举报
回复
不懂要学啊,这些都是基础的Java的问题,你要先学基础。
基础要靠自己,不要上来就问
qybao 2010-10-22
  • 打赏
  • 举报
回复
需要的包没有引入
zwb521 2010-10-22
  • 打赏
  • 举报
回复
还有这几个

An error occurred at line: 14 in the jsp file: /114look.jsp
Type mismatch: cannot convert from int to String
11: String ls_now="";
12: String ls_content="";
13: Calendar cal=Calendar.getInstance();
14: ls_now=cal.get(Calendar.DAY_OF_MONTH);
15:
16: String cantwrite="";
17: String filename = request.getRealPath(lsfn_time);


An error occurred at line: 42 in the jsp file: /114look.jsp
The operator || is undefined for the argument type(s) boolean, String
39: fr.close();
40: }
41:
42: if(ls_lasttime!=ls_now || request.getParameter("lsreload"))
43: {
44: try
45: {


An error occurred at line: 72 in the jsp file: /114look.jsp
Duplicate local variable filename
69:
70: if(cantwrite!="y")
71: {
72: String filename = request.getRealPath(lsfn_content);
73: java.io.File f = new java.io.File(filename);
74: if(!f.exists())
75: {


An error occurred at line: 73 in the jsp file: /114look.jsp
Duplicate local variable f
70: if(cantwrite!="y")
71: {
72: String filename = request.getRealPath(lsfn_content);
73: java.io.File f = new java.io.File(filename);
74: if(!f.exists())
75: {
76: try

JSP语法我不懂,呵呵
霜之哀伤 2010-10-22
  • 打赏
  • 举报
回复
An error occurred at line: 12 in the jsp file: /abcd.jsp
Calendar cannot be resolved to a type

这不是说的很明白么。
sling2007 2010-10-22
  • 打赏
  • 举报
回复
没有引入相应的包啊

在页面的加入
<%@ page import="java.util.*,java.io.*" %>
zwb521 2010-10-22
  • 打赏
  • 举报
回复
比如ls_now=cal.get(Calendar.DAY_OF_MONTH);

哪里有错啊,怎么强制转换成string

58,454

社区成员

发帖
与我相关
我的任务
社区描述
Java Eclipse
社区管理员
  • Eclipse
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧