2017年1月23日 星期一

如何更改session timeout?
1 網站的 session timeout 預設值30 min

2 變更整個網站的 session timeout 值(60 min) 修改web.xml:
  <webapp>
    ...
    <session-config>
      <session-timeout>60</session-timeout> <!-- in minutes -->
    </session-config>
  </webapp>


3 變更單一session timeout 值(60 min) 修改servlet:
getRequest().getSession().setMaxInactiveInterval(3600)

2016年5月17日 星期二

OS X Changing eclipse(Mars) project explorer tree view font size
Open Finder
right mouse click eclipse.app , click 顯示套件內容
open file Eclipse.app/Contents/Eclipse/plugins/org.eclipse.ui.themes_1.1.1.v20151026-1355/css/e4_basestyle.css
There I added :
.MPart Tree {
font-size: 13;
}

2012年11月16日 星期五

Eclipse自動佈屬到Tomcat

先概述一下我的NB開發環境:

(一)安裝JAVA JDK 於 C:\Program Files (x86)\Java\jdk1.6.0_31

(二)解壓縮 Eclipse Juno 於 C:\junoEclipse\eclipse

(三)解壓縮 Tomcat 於 D:\apache-tomcat-7.0.32

(四)Eclipse 設定

  1. 設定 Install JREs:

    Eclipse : Window >> Preferences

    Preferences : Java >> Installed JREs >> Add...

    JRE Type : Standard VM >> Next >

    JRE Definition : JRE home = C:\Program Files (x86)\Java\jdk1.6.0_31, Remove Eclipse JRE >> Finish

  2. 設定 Server Runtime Environments

    Eclipse : Window >> Preferences

    Preferences : Server >> Runtime Environments >> Add...

    New Server Runtime Environment : select Apache Tomcat v7.0, 勾選 Create a new local Server >> Next>

    Tomcat Server : Tomcat Installation directory=D:\apache-tomcat-7.0.32, JRE=jdk1.6.0_31 >> Finish
  3. 設定 Tomcat Server:

    Eclipse : Window >> Show View >> Servers

    Servers : 以滑鼠右鍵點選 Tomcat v7.0 Server as localhost >> Open

    Tomcat v7.0 Server as localhost :

    • Server locations:

      點選 Use Tomcat installation(takes control of Tomcat installation),

      Deploy Path=webapps

    • server Options :

      勾選Publish module contexts to separate XML files,

      勾選Modules auto reload by default,

      關閉Tomcat v7.0 Server視窗,Save Yes

  4. 新增 Dynamic Web Project:

    Eclipse : File >> New >> Dynamic Web Project

    New Dynamic Web Project : Project name=myWeb2, 其他使用預設值 >> Finish

  5. 新增 Hello Html :

    Project Explorer :以滑鼠右鍵點選myWeb2 >> New >> HTML File >> File name=index.html >> Finish

    index.html :在後輸入 Hello ! Html >> File >> Save

  6. 將 Web 專案佈屬到 Tomcat Server:

    Eclipse : Window >> Show View >> Servers

    Servers : 以滑鼠右鍵點選 Tomcat v7.0 Server as localhost >> Start

    Servers : 以滑鼠右鍵點選 Tomcat v7.0 Server as localhost >> Add and Remove...

    Add and Remove : Available: myWeb2 >> Add >> Finish

    Web Browser : 開啟網頁 http://localhost:8080/myWeb2/index.html,如果看到Hello ! Html ,就表示已經成功佈屬到Tomcat Server了!

Eclipse jQuery Error 的解決方法

最近利用Eclipse在學習jQuery,發現當我加入jQuery壓縮檔(jquery-1.8.2.min.js)後,發現會有驗證失敗的小圖示出現,雖然不會影響學習jQuery,但就是不喜歡在專案中出現紅色的小X(如下圖)。

利用Google搜尋後,發現可以設定JavaScript排除驗證以min.js結尾的檔案,來去除惱人的紅色小X,請參考以下設定步驟:

(一)Eclipse的Project Explore中以滑鼠右鍵點選專案後選擇Properties

(二)依序點選:JavaScript >>Include Path>>Source>>Excluded>>Edit...

(三)點選Exclusion patterns下的 Add...按鈕,輸入**/*.min.js (** : 代表所有目錄)後,點選OK按鈕。

最後按下Finish按鈕及OK按鈕(畫面省略)後,就成功移除惱人的紅色小X。