原创 開發日誌:hibernate映射,一個類映射多個表

在解決項目中一個表字段映射多個實體屬性的時候發現這個提問,覺得很有意思 一個User類有username,password屬性,還有otherInformation等其他屬性,username和password映射到一個表,otherIn

原创 開發日誌:使用jquery讀取id含./"等特殊符號的對象

使用struts標籤的時候遇到的問題:在使用對象.屬性的時候,由於習慣,將ID和Name命名相同 <s:textfield id="sbs.title" name="sbs.title" value="%{sbs.title}"></

原创 開發日誌:計算Java內一段代碼運行所用的時間

Date startTime = new Date(); Thread.sleep(1000);//邏輯代碼 Date endTime = new Date(); long lt = endTime.get

原创 iframe全局跳轉

js parent.window.location.href = "logout.action";   html <a href="logout.html" target="_parent">退出</a>    

原创 IE6在標籤中使用history.go(-1)返回上一頁無效

原來的,怎麼點都無效,雙擊還跳回主頁 <a href="javascript:void(0)" οnclick="javascript:history.go(-1);" > 【返回】</a>參考下面的帖子,我也加了個return f

原创 開發日誌:ssh配置實體映射時出錯could not instantiate id generator

很久沒新建實體映射文件了,一配置就出錯 使用的是mysql數據庫,Int類型自增id <id name="id" type="java.lang.Integer"> <column name="ID

原创 使用status獲取當前遍歷數據的行數、序號等操作

 <s:iterator value="#list" id="myEnt" status="status">          當前行數:<s:property value="%{#status.count}"/><br/>       

原创 開發日誌:hql 使用set數據條件查詢

有兩表Dept(單位)和Permission(權限),由hibernate維持多對多的關係 Dept private Set<Permission> permissions; <set name="permissions" la

原创 select根據值動態改變選中項

<script language="javascript"> //根據option的value值修改select的默認選項 function selectValues(obj,v){ if(obj!=null && v!=nul

原创 開發日誌:使用MyEclipse開發JavaWeb,無論怎麼改Java代碼都不生效,Tomcat報ClassNotFoundException錯誤

今天開發遇到這個奇葩的問題,弄了很久,開始的時候一直以爲代碼出錯,後來在新增加的判斷處加入了斷點,發現 if( obj ==null){ //代碼... }obj肯定爲nul的情況下,竟然也不會執行 //代碼  裏面的內容,BU

原创 s:select標籤簡單使用

<s:select name="years" id="years" list="#{1:'2012',2:'2013',3:'2014',4:'2015'}" listKey="key" listValue="value" heade

原创 開發日誌:解決spring版本導致的Cannot find the declaration of element 'beans',查看jar中的spring的版本

今天想用以前搭建好了的一個簡潔版ssh項目做測試,結果出現這個坑爹的錯誤, 解決過程相當曲折坑爹,下面開始介紹(要解決方案的可直接看藍色字體以下的內容) 以前搭建這個項目,運作過程中一直都沒出現這個錯誤,裏面已有對User、Type表的

原创 開發日誌:返回時出現網頁過期的解決方法

問題出現在一個action提交的頁面,點到其他頁面後,再返回就出現網頁過期 window.history.back() 是javascript的請求,由於session已經超時,使用window.history.back() 返回上一頁就

原创 開發日誌:js使用encodeURI要注意null,防止傳遞undefined

查詢條件使用js跳轉url,在傳遞中文參數的使用到了encodeURI,搜索後發現後臺數據查不出來 debug後發現SQL查詢在where條件中有個參數值是undefined 回到js去排查錯誤,發現alert(XXX)出現undef

原创 struts標籤消除自定義格式

轉自:http://blog.163.com/ruan1613@yeah/blog/static/9455407420101130115046895/ <s:form action="Login">     <table align="