Hibernate映射文件中映射Date:
<property name="postDate" type="java.util.GregorianCalendar">
<column name="aDate" sql-type="datatime"/>
</property>
提交前确认:
onclick="return confirm('are you sure?');";
struts标签中加入id:
<html:text property="sDate" styleId="sDate" styleClass="dd_text"></html:text>
就是那个元素不能设置id,也可以为它加个不影响显示的父元素(比如span),然后为这个元素设置id,取得这个元素对象就用——document.getElementById("parentId").firstChild;
1.struts的logic:equal和logic:notEqual标签,1.2以前只能比较String类型的,被比较的两个值都必须是String,否则比较不了。1.2之后的还未测试
2.oracle如果在分页时排序,可能会导致数据出错,解决办法是多加一个unique的字段排序,如主键ID.
3.select * from userinfo order by name desc, id asc,这样会以name先排序,再以id排序。
4.可以直接在javascript方法中写jsp语句段
透明div:
<div id="mask1" style="filter:alpha(opacity=50);-moz-opacity:.5;opacity:0.5;background:#000000;top: 0; left: 0;right:0;bottom:0;position:absolute;z-index:100; display:none;">
filter:alpha(opacity=50); --ie
-moz-opacity:.5; -- firefox 新版
opacity:0.5; --firefox 旧版
随机UUID:
new String(Hex.encodeHex(org.apache.commons.id.uuid.UUID.randomUUID().getRawBytes()))