2010年4月26日 星期一

取消TOMCAT管理頁面或是轉址

TOMCAT管理頁是放在webapps\ROOT\index.jsp下

先將這個檔案換名子或刪除

增加一支新的index.jsp內容為

2010年4月12日 星期一

foreach增加流水號

<c:forEach items="${beanList}" var="searchResult" varStatus="idStatus">
${idStatus.count}
</c:forEach>

2010年4月6日 星期二

Chinese_Taiwan_Stroke_BIN 與 Chinese_Taiwan_Stroke_CI_AS 之間的定序衝突

錯誤訊息:
Chinese_Taiwan_Stroke_BIN 與 Chinese_Taiwan_Stroke_CI_AS 之間的定序衝突
或是
Cannot resolve the collation conflict between "Chinese_Taiwan_Stroke_CI_AS" and "SQL_Latin1_General_CP1_CI_AS" in the equal to operation. [SQLSTATE 42000] (Error 468). The step failed

2009年11月24日 星期二

STRUTS2 傳遞參數

從action 傳list到jsp頁面的方式

1.

在action宣告private變數

並且產生set和get function

在jsp頁面的取法

<s:iterator value="變數">
<s:property value="元素" />
</s:iterator>

2009年10月28日 星期三

SQL取系統時間

輸出格式:2008-02-27 00:25:13
SELECT CONVERT(char(19), getdate(), 120)

輸出格式:2008-02-27
SELECT CONVERT(char(10), getdate(), 20)

輸出格式:2008.02.27
SELECT CONVERT(char(10), getdate(), 102)

2009年8月7日 星期五

STRUTS2新手常見問題

問題1:“Unable to load configuration. - bean - jar:file:/...../WEB-INF/lib/struts2-core-2.1.6.jar!/struts-default.xml:46:178”
解決:將commons-io-1.3.2.jar, commons-fileupload.1.2.1.jar放到lib下。

2009年8月4日 星期二

Jquery基本用法

取的文字方塊(text)中的值

<input id="testId" class="testClass" value="123" name="test">

有三種方式分別為

  1. 用name取值
  2. $("[name='test']").val() ;
  3. 用id取值
  4. $("#testId").val();
  5. 用class取值
  6. $(".testClass").val();

checkbox取得有勾選的值 
$('input[name=checkBoxName]:checked').each(function(){
alert($(this).val());
});

radio取得有勾選的值
$('input[name=radioName]:checked').val();

radio預設勾選
$('input[value=2]:radio').attr('checked', 'checked');
或是
$('input[value=2][name=radioName]').attr('checked', 'checked');
 
判斷指定元素是否存在
if($('#testId').length > 0){
//to do
}