Topic: jsp调用javabean问题

  Print this page

1.jsp调用javabean问题 Copy to clipboard
Posted by: YoYo
Posted on: 2004-08-16 00:24

在jsp中调用javabean中的方法时,总出现这样的问题:
Method setHuiYuanInfo(web.HuiYuanInfo)not found in class web.HuiYuanRegist.

javabean中函数setHriYuanInfo的代码是:
public void setHuiYuanInof(HuiYuanInfo info){
  this.huiyuaninfo=info;
}

web是我的名,HuiYuanInfo是我提取表单注册信息的bean,函数
setHuiYuanInfo()是我连接数据库bean中的函数。

请高手指点
谢谢!

2.Re:jsp调用javabean问题 [Re: YoYo] Copy to clipboard
Posted by: yuespace
Posted on: 2004-08-16 11:20

jsp代码发来看看

3.Re:jsp调用javabean问题 [Re: YoYo] Copy to clipboard
Posted by: YoYo
Posted on: 2004-08-16 11:56

<%@ page contentType="text/html;charset=GBK" %>
<%@ page language="java" import="web.*" %>
<jsp:useBean id="info" class="web.HuiYuanInfo" scope="page">
<jsp:setProperty name="info" property="*" />
</jsp:useBean>
<jsp:useBean id="regist" class="web.HuiYuanRegist" scope="page"/>
<%
regist.setHuiYuanInfo(info);
     regist.regist();
%>

4.Re:jsp调用javabean问题 [Re: YoYo] Copy to clipboard
Posted by: dennisjl
Posted on: 2004-08-16 15:10

你的属性(数据成员)是:huiyuaninfo, 它对应的set/get函数应该是:
setHuiyuaninfo(). 而不是:setHuiYuanInof().

set/get方法的规则是将属性的首字母大写,并加上set/get。而不能像上例中那样随意变换属性的大小写。

5.Re:jsp调用javabean问题 [Re: YoYo] Copy to clipboard
Posted by: YoYo
Posted on: 2004-08-16 17:36

还是不行,毛病依旧。


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923