---
title: "一句话开发经验"
author: "SnailWong"
date: "2008-09-25T17:13:07Z"
tags: ["Firefox", "Hibernate", "IE", "Oracle", "Struts"]
slug: "untitled"
draft: false
lastmod: "2008-12-25T16:55:25Z"
id: 246742
url: "https://snailwong.iteye.com/blog/246742"
---

Hibernate映射文件中映射Date:

&lt;property name="postDate" type="java.util.GregorianCalendar"&gt;    
 &lt;column name="aDate" sql-type="datatime"/&gt;    
&lt;/property&gt;

 

提交前确认:

onclick="return   confirm('are   you   sure?');";

 

struts标签中加入id:

&lt;html:text property="sDate" styleId="sDate" styleClass="dd\_text"&gt;&lt;/html:text&gt;

就是那个元素不能设置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:

&lt;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;"&gt;

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()))