初学,想写个最简单的bean,老是报同一个错

fyzeng 2004-10-26 07:02:46
换了几个例子,报的都是同一句错
就是这句:<jsp:useBean id="s" scope="page" class="hello"/>

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 2 in the jsp file: /hello.jsp
Generated servlet error:
hello cannot be resolved or is not a type

An error occurred at line: 2 in the jsp file: /hello.jsp
Generated servlet error:
hello cannot be resolved or is not a type

An error occurred at line: 2 in the jsp file: /hello.jsp
Generated servlet error:
hello cannot be resolved or is not a type
...全文
86 点赞 收藏 2
写回复
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
micker 2004-10-26
晕,找不到类啊!你看看你的class="hello"给确定对了,有包的要加上去啊,
回复
zhuxr2004 2004-10-26
hello这个类里应该建在包的下面.
就是在java程序最顶上加一句话package xxx;
然后在/web-inf/classs/下面建目录xxx.把class文件拷贝进去.
jsp改为:
<jsp:useBean id="s" scope="page" class="xxx.hello"/>
重新运行ok
回复
发动态
发帖子
Web 开发
创建于2007-09-28

7.9w+

社区成员

Java Web 开发
申请成为版主
社区公告
暂无公告