跳到主要內容

發表文章

[Struts2] iterator TextField -- Stirng[] object

jsp <s:iterator value="values" id="id"> <s:textfield name="values" value="%{id}"> </s:textfield> action.java private String values[]={"","",""}; public String[] getValues() { return values; } public void setValues(String s[]){ this.values=s; } 說明:在java要先宣告出 String[]的大小,然後才能在jsp中順利產生多個textfield input. 不過這樣做法沒辦法動態不同數量的textfield. reference: [Struts2] 內建的 OGNL Type Converter

[Oracle]JPA: How to Configure Primary Key Generation in Oracle

Using Sequence Objects When using a database that supports sequence objects (such as Oracle Database), you can configure JPA to use a database sequence object to automatically generate identifiers for your persistent objects. Using A Default Sequence TopLink JPA can produce a default sequence during schema generation. If you use schema generation, then specify that your identifier should be generated and that the SEQUENCE strategy be used to perform the generation. In the following example, the @GeneratedValue annotation indicates that the identifier value should be automatically generated; a strategy of SEQUENCE indicates that a database sequence should be used to generate the identifier. TopLink will create a default sequence object during schema generation. This object will be used by TopLink at run time. @Entity public class Inventory implements Serializable { @Id @GeneratedValue(strategy=GenerationType.SEQUENCE) private long id; Specifying a ...

[JavaScript]HTML DOM Select Object

--Collections |--[collection] options[] Returns an array of all the options in a dropdown list --Properties |--disabled Sets or returns whether or not a dropdown list should be disabled |--form Returns a reference to the form that contains the dropdown list |--id Sets or returns the id of a dropdown list |--length Returns the number of options in a dropdown list |--multiple Sets or returns whether or not multiple items can be selected |--name Sets or returns the name of a dropdown list |--selectedIndex Sets or returns the index of the selected option in a dropdown list |--size Sets or returns the number of visible rows in a dropdown list |--tabIndex Sets or returns the tab order for a dropdown list |--type Returns the type of form element a dropdown list is --Standard Properties |--className Sets or returns the class attribute of an element |--dir Sets or returns the direction of text |--lang Sets or returns the language code for an element |--title Sets or returns an elem...

[Javascript]用IE執行window.location.href 無效解決方案

在html(包含jsp.asp)檔案中某些時候用IE瀏覽頁面 如果有這段Javascript window.location.href="http://www.yahoo.com.tw"; 有些時候並無法正常把頁面導到 http://www.yahoo.com.tw 需要改寫成 var newUrl = url; setTimeout(function(){ window.location = newUrl;}, 0); 這樣才會正常執行

[Javascript]Javascript Countdown / setTimeout

Javascript <script type="text/javascript"> <!-- function CountDown(OffsetTime,DivName){ if(OffsetTime<=0){ document.getElementById(DivName).innerHTML = "時間到..."; } else{ mySec=(OffsetTime%60); if (mySec<10) mySec="0"+mySec; Other=Math.floor(OffsetTime/60); myMin=(Other%60); if (myMin<10) myMin="0"+myMin; expireTime=myMin+":"+mySec; document.getElementById(DivName).innerHTML =expireTime; OffsetTime--; setTimeout("CountDown('"+OffsetTime+"','"+DivName+"')",1000); } } //--> </script>< <body onload="CountDown('900','TimeDiv')"> <div id="TimeDiv""></div"> </body> </html> -- 2012-03-26 補充 如何停止setTimeout 可用以下的clearTimeout來停止 使用方法如下 meter1=setTimeout("delaySubmit()", 1000 ); clearTimeout(meter1);

[Web]fckeditor

FCKeditor 是個web介面視覺化的文字編輯器 有點像是web介面的word吧 支援多國語系也支援各種程式碼 支援程式碼包括:adobeAir,Active-FoxPro (afp) ,asp ,asp.net ,cfm , html, Java, lasso,perl ,php,py 使用設定很簡單 以asp為例 先宣告路徑 <!-- #INCLUDE file="fckeditor.asp" --> 再宣告物件 Dim oFCKeditor Set oFCKeditor = New FCKeditor oFCKeditor.BasePath = $[FCKeditor資料夾路徑] oFCKeditor.Value = $[載入時的內容] oFCKeditor.Create $[html物件的名稱] 其中 $[載入時的內容] 通常就是預先設定的資料或是從資料庫抓出來要編輯的資料 而 $[html物件的名稱] 就是之後form送出時的的參數名稱。 例如如果設定如下 oFCKeditor.Create "INPUT01" 那之後接收的action asp就要這去收資料 input01=request.form("INPUT01") 另外請在注意,如果宣告html物件的名稱已經在asp的程式碼中有了 雖然這樣會可以執行 但是送出的資料或多了"," 例如 asp原始碼這樣寫: <input type="hidden" name="hiddenField" id="hiddenField" /> <%Dim oFCKeditor Set oFCKeditor = New FCKeditor oFCKeditor.BasePath = $[FCKeditor資料夾路徑] oFCKeditor.Value = $[載入時的內容] oFCKeditor.Create "AAA" %> 這樣送出後的結果會變成 AAA , 所以要注意一下 詳細內容參考 fckeditor官方網站

[windows]安装、移除、修改Windows Services

指令:sc [create | delete | config] 服務名稱 [參數] 主要參數列表:   start= demand|boot|system|auto|disabled|delayed-auto  //啟動類型   binPath= BinaryPathName                 //執行檔路徑 depend= 依存關係(以 / 分隔)   DisplayName=                 //服務顯示名稱 安裝 sc create svnservice binpath= "d:\p\wangxudong.com\bin\svnserve.exe --service -r e:\repos" displayname= "svnservice" depend= Tcpip start= auto 删除 sc delete svnservice 修改設定 sc config svnservice binpath= "d:\p\wangxudong.com\bin\svnserve.exe --service -r e:\repos" displayname= "svnservice" depend= Tcpip 啟動服務 net start svnservice