求助:Unable to compile class for JSP,linux

a1111111984 2009-01-12 04:53:21
出错信息:

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: 7 in the generated java file
Only a type can be imported. com.utils resolves to a package

An error occurred at line: 16 in the jsp file: /console/default/fileUpload.jsp
utils cannot be resolved
13:
14: String dir = application.getRealPath("/")+"conf/config.xml";
15: System.out.println(dir);
16: String initpath = utils.getPath(dir);
17: System.out.println("---"+initpath+"---");
18:
19: String reqPath = "";

...全文
129 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
a1111111984 2009-01-13
  • 打赏
  • 举报
回复
多谢楼上的帮忙,类里面的有个地方写错了。呵呵
duoduo6153 2009-01-12
  • 打赏
  • 举报
回复
你把utils类名改成Utils,重新编译这个类。
a1111111984 2009-01-12
  • 打赏
  • 举报
回复
我是这样导入的: <%@ page import="com.utils"%>
web-inf/classes/com/ 下有utils.class这个东西啊
duoduo6153 2009-01-12
  • 打赏
  • 举报
回复
你在页面中怎么导入这个类的?
zhj92lxs 2009-01-12
  • 打赏
  • 举报
回复
你看看web-inf/classes/com/src下面有没有utils.class这个文件
a1111111984 2009-01-12
  • 打赏
  • 举报
回复
utils是我自己定义的一个类:utils.java 放在该项目文件中的com/src文件夹下。
duoduo6153 2009-01-12
  • 打赏
  • 举报
回复
Only a type can be imported. com.utils resolves to a package
&
utils cannot be resolved
原因都显示出来了,不认识utils,com.utils按包路径解析了。utils是类吗?名字小写了?
a1111111984 2009-01-12
  • 打赏
  • 举报
回复
我的环境是linux下 tomcat6.0+jdk1.6

81,092

社区成员

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

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