白送分的问题!

7771362 2004-04-29 04:59:53
我想试用一下javabean,但是为什么老是包错
500 Servlet Exception
/test/helloBean.jsp:3: jsp:useBean can't find class `helloBean.helloBean'
-------------------------------------------------------------------------
Resin 2.1.9 (built Tue Apr 15 14:28:40 PDT 2003)
我把这2个文件已经放到一起了,并且也把.java编译了,可是还是不行,请指教
helloBean.java
package helloBean;
public class helloBean
{
String s;
public helloBean()
{
this.s="hello!Bean";
}
public void setString(String mystring)
{
this.s=mystring;
}
public String getString()
{
return(this.s);
}
}
helloBean.jsp
<html>
<body bgcolor="#ffffff">
<jsp:useBean id="HW" scope="request" class="helloBean.helloBean"/>
<div align="center">
<p><br>
<font size="+2">no.1 hello</font><br>
<font size="+4">
<%=HW.getString()%>
<%HW.setString("hello!word");%></font>
<br>
</p>
<p> </p>
<p><font size="+2">no.2 hello</font><br>
<font size="+4"><%=HW.getString()%></font></p>
</div>
</body>
</html>在线等你的回答!!!!
...全文
69 7 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
7771362 2004-04-29
  • 打赏
  • 举报
回复
谢谢!解决了!!!
joy19 2004-04-29
  • 打赏
  • 举报
回复
你的class放的地方不对!
xiaoyao008 2004-04-29
  • 打赏
  • 举报
回复
*.class放到web-inf----->classes-->下试试!
Philzzf 2004-04-29
  • 打赏
  • 举报
回复
你要确保helloBean.class 放在 你的WEB应用目录/WIN-INF/classes/helloBean目录下面,你是这么做的吗?
jinsfree 2004-04-29
  • 打赏
  • 举报
回复
class文件放到web_inf\classes\hellobean
而且你的hellobean要加上
package hellobean;
simon11111122222 2004-04-29
  • 打赏
  • 举报
回复
你那里改为用import 语句可以的啊
amortal 2004-04-29
  • 打赏
  • 举报
回复
看看你的class在什么地方,估计放的位置不对

81,122

社区成员

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

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