<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    jasmine214--love

    只有當你的內心總是充滿快樂、美好的愿望和寧靜時,你才能擁有強壯的體魄和明朗、快樂或者寧靜的面容。
    posts - 731, comments - 60, trackbacks - 0, articles - 0
    ?
    原文:http://chanson.javaeye.com/blog/164786
    1、Spring+Hibernate配置起來很簡單,具體就不細說了,網上多的是。

    2、ZK顯示頁面
    【query.zul】
    <?xml version="1.0" encoding="UTF-8"?>
    <window>
    <button label="查詢"></button>
    <vbox>
    ? <listbox id="testListID" width="800px" rows="5" use="chanson.common.web.ui.ListTestBean">
    ??? <listhead>
    ????? <listheader label="姓名"/>
    ????? <listheader label="性別"/>
    ????? <listheader label="生日"/>
    ????? <listheader label="薪資"/>
    ??? </listhead>
    ??? <listitem value="${each.id}" forEach="${testList}">
    ????? <listcell label="${each.name}"/>
    ????? <listcell label="${each.sex}"/>
    ????? <listcell label="${each.birthday}"/>
    ????? <listcell label="${each.money}"/>
    ??? </listitem>
    ? </listbox>
    </vbox>
    </window>

    《說明》:
    A、<?xml version="1.0" encoding="UTF-8"?>
    這個別忘記了,剛學的時候就是因為它報了不少錯誤。
    B、use="chanson.common.web.ui.ListTestBean"
    這個類就是銜接前后臺的關鍵類。
    C、${*.*}這個是標準的EL寫法。


    3、ListTestBean——最關鍵的銜接類
    public class ListTestBean extends Listbox {

    ??? public void onCreate() {
    ??? ? ITestLogic testLogic = (ITestLogic) SpringFactory
    ? .getBeanFactory().getBean("testLogic");
    ??? ? List testList = testLogic.find("from Test");
    ??????? Iterator it = testList.iterator();
    ??????? while(it.hasNext()) {
    ??????????? Test test = (Test) it.next();
    ??????????? Long id = test.getId();
    ??????????? String name = test.getName();
    ??????????? Integer sex = test.getSex();
    ??????????? Date birthday =test.getBirthday();
    ??????????? Double money = test.getMoney();??????

    ??????????? Listitem listitem = new Listitem();
    ??????????? listitem.setValue(id);
    ??????????? listitem.setParent(this);

    ??????????? Listcell nameCell = new Listcell(name);
    ??????????? Listcell sexCell = new Listcell(sex.toString());
    ??????????? Listcell birthdayCell = new Listcell(birthday.toString());
    ??????????? Listcell moneyCell = new Listcell(money.toString());
    ??????????? nameCell.setParent(listitem);
    ??????????? sexCell.setParent(listitem);
    ??????????? birthdayCell.setParent(listitem);
    ??????????? moneyCell.setParent(listitem);
    ??????? }
    ???? }
    }
    《說明》:
    A、例子是一個簡單的查詢,所以看起來也比較簡單。
    B、該類的作用有點像似servlet,只是省略了頁面跳轉
    C、setter/getter真是麻煩,得找找更簡潔的方法



    【附錄】
    1)、數據庫設計——test表
    CREATE TABLE `test` (
    ? `id` decimal(22,0) NOT NULL default '0',
    ? `name` varchar(100) default NULL,
    ? `sex` int(1) default NULL,
    ? `birthday` datetime default NULL,
    ? `money` decimal(15,4) default NULL,
    ? PRIMARY KEY? (`id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
    2)、其他應該沒什么了吧?
    3)、頁面效果圖
    • 描述: 頁面效果圖
    • 大小: 27.5 KB
    主站蜘蛛池模板: 亚洲黄片手机免费观看| 羞羞的视频在线免费观看| 大地影院MV在线观看视频免费| 免费99热在线观看| 无套内谢孕妇毛片免费看看| 亚洲精品国产精品乱码不卡| www.av在线免费观看| 亚洲女同成av人片在线观看| 中文字幕免费不卡二区| 亚洲av无码不卡一区二区三区 | 久久亚洲精品无码观看不卡| 爱情岛论坛免费视频| 久久激情亚洲精品无码?V| 国产免费一区二区视频| 亚洲精品亚洲人成在线麻豆| 久久久久国色AV免费观看性色 | 特级毛片在线大全免费播放| 亚洲综合最新无码专区| 青青操在线免费观看| 久久综合亚洲色一区二区三区| 69式互添免费视频| 亚洲精品国产首次亮相| 91麻豆精品国产自产在线观看亚洲 | 亚洲国产精品无码中文字| 最近的中文字幕大全免费8| 亚洲综合精品成人| 亚洲免费日韩无码系列| 青青草无码免费一二三区| 亚洲精品无码一区二区| 久久精品亚洲福利| 114一级毛片免费| 黄色毛片免费观看| 中文字幕在线观看亚洲| 国产精品国产自线拍免费软件| 视频免费在线观看| 亚洲视频无码高清在线| 国产亚洲精品不卡在线| 国国内清清草原免费视频99| 又硬又粗又长又爽免费看| 亚洲欧洲久久精品| 亚洲视频人成在线播放|