
2007年10月14日
分頁弄好了,還不夠完善。。
######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 神的小火柴 閱讀(177) |
評論 (0) |
編輯 收藏
主鍵生成方式
使用存儲過程
完整的配置方式
posted @
2007-10-18 14:13 神的小火柴 閱讀(170) |
評論 (0) |
編輯 收藏
spring 配置要點
http://wiki.springside.org.cn/display/springside/Spring+DistillSelenium指南
http://wiki.springside.org.cn/display/springside/Seleniumspringside
http://wiki.springside.org.cn/display/springside/Home
posted @
2007-10-17 01:22 神的小火柴 閱讀(182) |
評論 (0) |
編輯 收藏
################
<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 神的小火柴 閱讀(244) |
評論 (0) |
編輯 收藏
可以使用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 神的小火柴 閱讀(255) |
評論 (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 神的小火柴 閱讀(286) |
評論 (0) |
編輯 收藏
mysql中文亂碼的問題
我是用phpmyadmin把每個中文字段設置為
utf8-unicode類型的
posted @
2007-10-14 03:25 神的小火柴 閱讀(184) |
評論 (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 神的小火柴 閱讀(2255) |
評論 (2) |
編輯 收藏
blogjava要先申請注冊,如果你的注冊被允許,會在郵箱收到注冊地址。
我運氣還是挺好的嘛,一次就申請到了。
不知道是不是blogjava每個申請都會通過的。
PS:發現編輯框會隨時閃爍。。。
firefox下倒沒有發現這樣的情況
posted @
2007-10-14 02:46 神的小火柴 閱讀(280) |
評論 (2) |
編輯 收藏