分頁弄好了,還不夠完善。。
######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}
主鍵生成方式
使用存儲過程
完整的配置方式
######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}
主鍵生成方式
使用存儲過程
完整的配置方式
spring 配置要點
http://wiki.springside.org.cn/display/springside/Spring+Distill
Selenium指南
http://wiki.springside.org.cn/display/springside/Selenium
springside
http://wiki.springside.org.cn/display/springside/Home
http://wiki.springside.org.cn/display/springside/Spring+Distill
Selenium指南
http://wiki.springside.org.cn/display/springside/Selenium
springside
http://wiki.springside.org.cn/display/springside/Home
################
<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>
<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>
可以使用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 }"/> 嚴重: 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"
mysql中文亂碼的問題
我是用phpmyadmin把每個中文字段設置為
utf8-unicode類型的
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
<%@ ? 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 }"/> 嚴重: 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"
mysql中文亂碼的問題
我是用phpmyadmin把每個中文字段設置為
utf8-unicode類型的
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
blogjava要先申請注冊,如果你的注冊被允許,會在郵箱收到注冊地址。
我運氣還是挺好的嘛,一次就申請到了。
不知道是不是blogjava每個申請都會通過的。
PS:發現編輯框會隨時閃爍。。。
firefox下倒沒有發現這樣的情況
| |||||||||
日 | 一 | 二 | 三 | 四 | 五 | 六 | |||
---|---|---|---|---|---|---|---|---|---|
25 | 26 | 27 | 28 | 29 | 30 | 31 | |||
1 | 2 | 3 | 4 | 5 | 6 | 7 | |||
8 | 9 | 10 | 11 | 12 | 13 | 14 | |||
15 | 16 | 17 | 18 | 19 | 20 | 21 | |||
22 | 23 | 24 | 25 | 26 | 27 | 28 | |||
29 | 30 | 1 | 2 | 3 | 4 | 5 |
常用鏈接
留言簿(1)
隨筆分類
隨筆檔案
文章分類
搜索
最新評論

- 1.?re: parse錯誤
- 厲害!解決了。。。
- --date
- 2.?re: parse錯誤
-
非常感謝!
我從中受益! - --zlm
- 3.?re: 感謝blogjava
-
@dudu
原來是這樣啊 - --神的小火柴
- 4.?re: 感謝blogjava
-
BlogJava的注冊申請是人工審批的。
IE 7下也不會閃爍。 - --dudu