2 tiantong 47 Tiantong_47 于 2013.06.18 20:13 提问

急求解答,对象实例化问题!!!

是JSP+Servlet+JavaBean+mysql,用MyEclipse做的一个简单网站,遇到了如下问题:定义了类,在jsp页面引用时,用import导入了之后还是出错!
package wyf.zrk;

public class AdminBean
{
private int curPage = 1;
private String sql;
private int totalPage = 1;

public int getCurPage()
{
    return this.curPage;
}

public void setCurPage(int curPage)
{
    this.curPage = curPage;
}

public void setSql(String sql)
{
    this.sql = sql;
}

public String getSql()
{
    return this.sql;
}

public int getTotalPage()
{
    return this.totalPage;
}

public void setTotalPage(int totalPage)
{
    this.totalPage = totalPage;
}

public String manageStr(String str)
{
    String info = "";
    String[] msg = str.split("\\|");
    for(String temp:msg)
    {
        info = info+temp+"   ";
    }
    return info;
}

}

<%@ page contentType="text/html;charset=utf8" pageEncoding="utf8"%>
<%@ page import="wyf.zrk.AdminBean,wyf.zrk.DBcart,java.util.*"%>

<%
Vector vgoods = (Vector)request.getAttribute("vgoods");
if(vgoods==null)
{
adBean.setCurPage(1);
String gsql = "select Gimgurl,Gname,Gintro,Gclass,"+
"Gprice,Glook,Gid,Gdate from GoodsInfo";
int totalpage = DBcart.getTotalPage("select count(*) from GoodsInfo");
adBean.setTotalPage(totalpage);
adBean.setSql(gsql);
vgoods = DBcart.getPageContent(1,gsql);
}

1个回答

u011121287
u011121287   2013.06.18 22:47

能将报的错误截个图吗????adBean是从哪里来的啊???

Csdn user default icon
上传中...
上传图片
插入图片