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

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

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

    jasmine214--love

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

    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"
    這個類就是銜接前后臺的關(guān)鍵類。
    C、${*.*}這個是標準的EL寫法。


    3、ListTestBean——最關(guān)鍵的銜接類
    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,只是省略了頁面跳轉(zhuǎn)
    C、setter/getter真是麻煩,得找找更簡潔的方法



    【附錄】
    1)、數(shù)據(jù)庫設(shè)計——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)、其他應(yīng)該沒什么了吧?
    3)、頁面效果圖
    • 描述: 頁面效果圖
    • 大小: 27.5 KB
    主站蜘蛛池模板: 亚洲av永久无码精品秋霞电影秋 | 亚洲A∨精品一区二区三区下载| 日韩中文字幕免费| 精品多毛少妇人妻AV免费久久| 亚洲免费精彩视频在线观看| 毛片免费在线播放| 国产无限免费观看黄网站| 亚洲第一成年网站大全亚洲| 国产a级特黄的片子视频免费| 免费av一区二区三区| 亚洲日韩中文字幕一区| 亚洲综合AV在线在线播放| 国产福利在线观看免费第一福利| 免费人人潮人人爽一区二区| 久久亚洲精品无码aⅴ大香 | 国产精品亚洲产品一区二区三区| 亚洲成人免费网站| 99视频免费在线观看| 亚洲啪AV永久无码精品放毛片| 国产aⅴ无码专区亚洲av| 国产成人免费a在线资源| 一级毛片在线观看免费| 无码毛片一区二区三区视频免费播放| 麻豆亚洲AV永久无码精品久久 | 国产麻豆免费观看91| 热re99久久6国产精品免费| 女人裸身j部免费视频无遮挡| 亚洲偷自精品三十六区| 久久亚洲国产精品一区二区| 又粗又大又长又爽免费视频| 91免费资源网站入口| 一级毛片免费观看不卡的| 9久热精品免费观看视频| 色欲aⅴ亚洲情无码AV| 亚洲综合色区中文字幕| 亚洲福利在线视频| 色噜噜噜噜亚洲第一| 亚洲欧洲日韩国产| 亚洲人成影院在线| 亚洲av永久无码精品秋霞电影影院 | 一二三四免费观看在线电影|