从数据库拿数据,并把值绑到界面上去
实体类:book.java
package com.zking.etity;
import java.io.Serializable;
public class Book implements Serializable{
private static final long serialVersionUID = 1L;
private int bid;
private String bname;
private int bprice;
private String btype;
public int getBid() {
return bid;
}
public void setBid(int bid) {
this.bid = bid;
}
public String getBname() {
return bname;
}
public void setBname(String bname) {
this.bname = bname;
}
public int getBprice() {
return bprice;
}
public void setBprice(int bprice) {
this.bprice = bprice;
}
public String getBtype() {
return btype;
}
public void setBtype(String btype) {
this.btype = btype;
}
public Book() {
// TODO Auto-generated constructor stub
}
public Book(int bid, String bname, int bprice, String btype) {
super();
this.bid = bid;
this.bname = bname;
this.bprice = bprice;
this.btype = btype;
}
public Book(String bname, int bprice, String btype) {
this.bname = bname;
this.bprice = bprice;
this.btype = btype;
}
@Override
public String toString() {
return "Book [bid=" + bid + ", bname=" + bname + ", bprice=" + bprice + ", btype=" + btype + "]";
}
}
Module.java
package com.zking.etity;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**实体类
* @author zjjt
*
*/
public class Module implements Serializable {
private static final long serialVersionUID = 6951631954282202090L;
private int id;
private int pid;
private String text;
private String url;
private String iconCls;
private int sort;
//子节点集合
private List<Module> children =new ArrayList<Module>();
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getPid() {
return pid;
}
public void setPid(int pid) {
this.pid = pid;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getIconCls() {
return iconCls;
}
public void setIconCls(String iconCls) {
this.iconCls = iconCls;
}
public int getSort() {
return sort;
}
public void setSort(int sort) {
this.sort = sort;
}
public List<Module> getChildren() {
return children;
}
public void setChildren(List<Module> children) {
this.children = children;
}
public Module() {
// TODO Auto-generated constructor stub
}
public Module(int id, int pid, String text, String url, String iconCls, int sort, List<Module> children) {
super();
this.id = id;
this.pid = pid;
this.text = text;
this.url = url;
this.iconCls = iconCls;
this.sort = sort;