隨筆 - 45, 文章 - 2, 評(píng)論 - 11, 引用 - 0
          數(shù)據(jù)加載中……

          2011年4月26日

          JSTL的使用

          1、在jsp文件的頭部加入
          <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>

          2、<c:froEach/>的使用
           1<%
           2        OperationDAO opDao = new OperationDAOImpl();
           3        List<Operation> ops = opDao.getAll_();
           4        MenuDAO meDao = new MenuDAOImpl();
           5        List<Menu> mes = meDao.getAll_Lazy(1) ;
           6    %>
           7            <table id="demoTable" border="1">
           8            <thead>
           9                <th>id</th>
          10                <th>顯示名稱(chēng)</th>
          11                <th>鏈接</th>
          12                <th>所屬菜單</th>
          13                <th>是否可見(jiàn)</th>
          14                <th>操作</th>
          15            </thead>
          16            <tbody>
          17                <c:forEach var="op" items="<%=ops %>">
          18                    <tr id="${op.op_Id}"
          19                        class="{op_Id:${op.op_Id},op_displayName:'${op.op_displayName}',op_link:'${op.op_link }',me_name:'${op.menu.me_displayName}',viewMode:'${op.viewMode}'}">
          20                        <td class="op_Id">${op.op_Id}</td>
          21                        <td class="op_displayName">${op.op_displayName}</td>
          22                        <td class="op_link">${op.op_link }</td>
          23                        <td class="me_name">${op.menu.me_displayName}</td>
          24                        <td class="viewMode">viewMode:${op.viewMode}</td>
          25                        <td><class="editRecord" href="anotherPage.html">Edit</a> |
          26                            <class="deleteRecord" href="anotherPage.html">Delete</a></td>
          27                    </tr>
          28                </c:forEach>
          29            </tbody>
          30        </table>



          posted @ 2011-05-08 23:16 jack zhai 閱讀(212) | 評(píng)論 (0)編輯 收藏

          spring的一般配置

          beans.xml

          beans

           

           

          jdbc.properties

          properties

          在web.xml里加入

          web.xml


           

          posted @ 2011-05-01 14:26 jack zhai 閱讀(233) | 評(píng)論 (0)編輯 收藏

          powerdesigner反向生成物理模型

          需要先安裝ODBC,才可以使用ODBC連接方式連接數(shù)據(jù)庫(kù)

          下載地址:mysql-connector-odbc-5.1.8-win32.msi

          1

          1

          2

          2

          3

          3

          4

          4

           

          5

          5

          posted @ 2011-04-29 13:13 jack zhai 閱讀(457) | 評(píng)論 (0)編輯 收藏

          使用SchemaExport自動(dòng)生成表結(jié)構(gòu)

            new SchemaExport(new AnnotationConfiguration().configure()).create(false, true);

          posted @ 2011-04-29 08:09 jack zhai 閱讀(333) | 評(píng)論 (0)編輯 收藏

          hibernate配置模板

          <?xml version='1.0' encoding='gb2312'?>  
          <!DOCTYPE hibernate-configuration PUBLIC  
                  "-//Hibernate/Hibernate Configuration DTD 3.0//EN" 
                  "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">  
          <hibernate-configuration>  
              <session-factory>  
                  <!--顯示執(zhí)行的SQL語(yǔ)句-->  
                  <property name="show_sql">true</property>  
                  <!--連接字符串-->  
                  <property name="connection.url">jdbc:mysql://localhost:3306/Test</property>  
                  <!--連接數(shù)據(jù)庫(kù)的用戶(hù)名-->  
                  <property name="connection.username">sa</property>  
                  <!--數(shù)據(jù)庫(kù)用戶(hù)密碼-->  
                  <property name="connection.password">sa</property>  
                  <!--數(shù)據(jù)庫(kù)驅(qū)動(dòng)-->  
                  <property name="connection.driver_class">com.mysql.jdbc.Driver</property>  
                  <!--JDBC連接池(使用內(nèi)置的連接池)-->  
                  <property name="connection.pool_size">1</property>  
                  <!--設(shè)置Hibernate自動(dòng)管理上下文的策略-->  
                  <property name="current_session_context_class">thread</property>  
                  <!--選擇使用的方言-->  
                  <property name="dialect">org.hibernate.dialect.MySQLDialect</property>  
                  <!--在啟動(dòng)時(shí)刪除并重新創(chuàng)建數(shù)據(jù)庫(kù)-->  
                  <property name="hbm2ddl.auto">create</property>  
                  <mapping resource="events/User.hbm.xml"/>  
                  <mapping resource="events/Student.hbm.xml"/>  
              </session-factory>  
          </hibernate-configuration> 

           

          posted @ 2011-04-28 18:25 jack zhai 閱讀(300) | 評(píng)論 (0)編輯 收藏

          鏈表-java實(shí)現(xiàn)

          interface

          implement

          node

          posted @ 2011-04-26 05:57 jack zhai 閱讀(272) | 評(píng)論 (0)編輯 收藏

          主站蜘蛛池模板: 乾安县| 内丘县| 靖江市| 聂拉木县| 乌拉特前旗| 景泰县| 莱芜市| 阿拉善右旗| 牡丹江市| 宿松县| 蒙山县| 桦甸市| 清丰县| 永宁县| 郑州市| 遵化市| 常州市| 富阳市| 昌宁县| 咸阳市| 遵义县| 康保县| 涞水县| 乾安县| 汤原县| 怀柔区| 上蔡县| 新疆| 临武县| 贺兰县| 龙海市| 肇源县| 同江市| 武宁县| 宜川县| 延长县| 河北区| 东海县| 红原县| 木里| 朝阳区|