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 神的小火柴 阅读(167) | 评论 (0)编辑 收藏
主键生成方式
使用存储过程
完整的配置方式
posted @ 2007-10-18 14:13 神的小火柴 阅读(161) | 评论 (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 神的小火柴 阅读(234) | 评论 (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 神的小火柴 阅读(244) | 评论 (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 神的小火柴 阅读(273) | 评论 (0)编辑 收藏
mysql中文乱码的问题

我是用phpmyadmin把每个中文字段设置为
utf8-unicode类型的
posted @ 2007-10-14 03:25 神的小火柴 阅读(170) | 评论 (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 神的小火柴 阅读(2240) | 评论 (2)编辑 收藏

blogjava要先申请注册,如果你的注册被允许,会在邮箱收到注册地址。
我运气还是挺好的嘛,一次就申请到了。
不知道是不是blogjava每个申请都会通过的。

PS:发现编辑框会随时闪烁。。。

firefox下倒没有发现这样的情况

posted @ 2007-10-14 02:46 神的小火柴 阅读(263) | 评论 (2)编辑 收藏
仅列出标题  
<2024年3月>
252627282912
3456789
10111213141516
17181920212223
24252627282930
31123456

常用链接

留言簿(1)

随笔分类

随笔档案

文章分类

搜索

  •  

最新评论

阅读排行榜

评论排行榜