posts - 7,  comments - 4,  trackbacks - 0
            2007年10月18日
          分頁弄好了,還不夠完善。。

          ######EL表達式讀取屬性

          class A{
          ??? public int getNext(){
          ??? ?? return 1;
          ??? }
          }

          request.setAttribute("a",new A);
          ${a.next }

          #########logic的用法

          <logic:equal name="testForm" property="paginationInfo.hasNext" value="true">
          <logic:equal name="testForm" property="paginationInfo.currentPageNumber" value="1">

          #########param
          reqeust.getParameter("page") ${param.page}
          reqeust.getAttribute("page") ${page}
          posted @ 2007-10-18 23:31 神的小火柴 閱讀(180) | 評論 (0)編輯 收藏
          主鍵生成方式
          使用存儲過程
          完整的配置方式
          posted @ 2007-10-18 14:13 神的小火柴 閱讀(173) | 評論 (0)編輯 收藏
            2007年10月15日
          ################
          <div></div>
          <div style="clear:both;" />
          <div></div>
          這樣可以讓第一個div和第二個div按從上到下排列。
          比float:left麻煩點,增加了不必要的div

          ###############
          Expression.eq("linkIsShow","true")
          這樣會導致錯誤:java.lang.ClassCastException: java.lang.String

          正確的:
          Criteria criteria=this.getSession().createCriteria(BlogLinks.class);
          criteria.add(Expression.eq("linkIsShow",true));
          return criteria.list();

          今天主要要解決分頁的問題。。
          錯誤提示頁面。。

          #################
          奇怪的問題。如果設置了setFetchSize()之后,不但不起作用。連addOrder()也沒用了。
          改用setMaxResults()之后,一切正常。
          Criteria criteria=this.getSession().createCriteria(BlogContent.class);
          criteria.addOrder(Order.desc("logId"));
          criteria.setFirstResult(0);
          criteria.setMaxResults(5);
          return criteria.list();

          ################
          <ul id="posts"><li></li></ul>

          這樣是錯誤的:
          #content ul #posts{margin-bottom: 20px;}
          #content ul #posts li{margin-bottom: 36px;}

          這是正確的:
          #content ul#posts{margin-bottom: 20px;}
          #content ul#posts li{margin-bottom: 36px;}

          ################
          老是犯低級錯誤

          HTML中<div>一定要這樣<div></div>
          這樣肯定出錯<div/>,會自動嵌套。。

          這個問題搞得我莫名其妙了好久。。

          ###############
          這樣是錯的。。

          <property name="phone" type="string">
          ??? <column name="PHONE" sql-type="varchar(8)"/>
          </property>
          posted @ 2007-10-15 13:03 神的小火柴 閱讀(246) | 評論 (0)編輯 收藏
            2007年10月14日
          可以使用fmt
          <%@ ? taglib ? prefix="fmt" ? uri="http://java.sun.com/jstl/fmt" ? % >

          出現錯誤
          javax.servlet.ServletException: org.apache.jasper.JasperException: /home.jsp(81,9) According to TLD or attribute directive in tag file, attribute value does not accept any expressions

          改為:
          <%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>

          PS:classpath中必須加入standard.jar和jstl.jar


          <fmt:formatDate pattern="yyyy-mm-dd" value="${content.logPosttime }"/>
          posted @ 2007-10-14 17:47 神的小火柴 閱讀(257) | 評論 (0)編輯 收藏
          嚴重: Servlet.service() for servlet jsp threw exception
          org.hibernate.LazyInitializationException: could not initialize proxy - no Session

          用hibernate的daosupporr繼承類讀取所有內容表,放到request中,jsp頁面顯示。
          如果讀取內容表外鍵關聯的類別表的內容就出錯。

          hibernate3 many-to-one的默認選項為lazy="proxy"

          把many-to-one或one-to-many的屬性lazy改為lazy="false"


          posted @ 2007-10-14 17:19 神的小火柴 閱讀(288) | 評論 (0)編輯 收藏
          mysql中文亂碼的問題

          我是用phpmyadmin把每個中文字段設置為
          utf8-unicode類型的
          posted @ 2007-10-14 03:25 神的小火柴 閱讀(186) | 評論 (0)編輯 收藏
          org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/config-spring.xml]: Invocation of init method failed; nested exception is org.hibernate.InvalidMappingException: Could not parse mapping document from input stream
          Caused by: org.hibernate.InvalidMappingException: Could not parse mapping document from input stream

          替換hbm.xml文件的DTD為

          <!DOCTYPE hibernate-mapping PUBLIC
          ??? "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
          ??? "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">


          可以參考一下:
          http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd
          posted @ 2007-10-14 03:10 神的小火柴 閱讀(2258) | 評論 (2)編輯 收藏

          blogjava要先申請注冊,如果你的注冊被允許,會在郵箱收到注冊地址。
          我運氣還是挺好的嘛,一次就申請到了。
          不知道是不是blogjava每個申請都會通過的。

          PS:發現編輯框會隨時閃爍。。。

          firefox下倒沒有發現這樣的情況

          posted @ 2007-10-14 02:46 神的小火柴 閱讀(283) | 評論 (2)編輯 收藏
          僅列出標題  
          <2025年6月>
          25262728293031
          1234567
          891011121314
          15161718192021
          22232425262728
          293012345

          常用鏈接

          留言簿(1)

          隨筆分類

          隨筆檔案

          文章分類

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 泗阳县| 许昌市| 岳阳市| 滦南县| 南康市| 陈巴尔虎旗| 郓城县| 崇信县| 新沂市| 金堂县| 玉门市| 达孜县| 兰坪| 福州市| 莱阳市| 漳州市| 广德县| 龙江县| 集安市| 诏安县| 宁晋县| 城固县| 会东县| 洞口县| 英吉沙县| 玛曲县| 江西省| 行唐县| 三亚市| 胶南市| 夏河县| 乡城县| 太原市| 蒙阴县| 乌鲁木齐市| 罗田县| 东兰县| 元朗区| 五常市| 枣强县| 喀喇沁旗|