- Feb 23 Sun 2014 15:01
-
[紙模]烈火武者鋼彈-武器
- Feb 23 Sun 2014 14:46
-
[紙模]烈火武者鋼彈-手部
- Feb 23 Sun 2014 14:34
-
[紙模]烈火武者鋼彈-腳部
- Feb 21 Fri 2014 18:25
-
How to get the HttpServletRequest in Struts 2
Struts 2 可透過 org.apache.struts2.ServletActionContext 來取得 HttpServletRequest
HttpServletRequest request = ServletActionContext.getRequest();
HttpServletRequest request = ServletActionContext.getRequest();
- Feb 21 Fri 2014 18:14
-
How to get ip address in java servlet
一般都是用下列的方式來取得客戶端的 ip 位址
String ipAddress = request.getRemoteAddr();
可是當客戶端是經過 proxy server 或是 load balancer server 來連接,這樣就取不到原始的 ip 位址,此時要透過 http request Header 中的 X-FORWARDED-FOR 來取得 ip 位址
String ipAddress = request.getHeader("X-FORWARDED-FOR");
String ipAddress = request.getRemoteAddr();
可是當客戶端是經過 proxy server 或是 load balancer server 來連接,這樣就取不到原始的 ip 位址,此時要透過 http request Header 中的 X-FORWARDED-FOR 來取得 ip 位址
String ipAddress = request.getHeader("X-FORWARDED-FOR");
- Feb 19 Wed 2014 22:17
-
[紙模]烈火武者鋼彈-腰部
- Feb 19 Wed 2014 21:55
-
[紙模]烈火武者鋼彈-胸部
- Feb 19 Wed 2014 21:52
-
[紙模]烈火武者鋼彈-頭部
- Feb 19 Wed 2014 21:52
-
Google Play 無法連線
沒想到 Google Play 無法連線感覺還蠻常遇到的,除了網路一票解法,更有可能只是"日期跑掉了,恢復19xx年",造成無法連線,這時只要設定好日期,一切就又安好如初了
- Nov 15 Fri 2013 14:32
-
How to get the characters right?
有時候一個小疏忽,付出的代價就是要抓蟲抓半天....
網頁最常遇到就是亂碼的問題,java要取得正確的編碼,有幾個地方要設對
1. in jsp, use pageEncoding to set the response character encoding.
<%@page contentType="text/html" pageEncoding="UTF-8"%>
2. in html, set the charset attribute of the HTTP Content-Type header.
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
3. 再來就是透過ServletRequest#setCharacterEncoding來解決server端decode的問題。且最重要的是setCharacterEncoding要在讀取request parameter前就設定,否則無效。
一時的虧手,不小心加了getParameter在網頁最上面,亂碼就出現了.........
網頁最常遇到就是亂碼的問題,java要取得正確的編碼,有幾個地方要設對
1. in jsp, use pageEncoding to set the response character encoding.
<%@page contentType="text/html" pageEncoding="UTF-8"%>
2. in html, set the charset attribute of the HTTP Content-Type header.
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
3. 再來就是透過ServletRequest#setCharacterEncoding來解決server端decode的問題。且最重要的是setCharacterEncoding要在讀取request parameter前就設定,否則無效。
一時的虧手,不小心加了getParameter在網頁最上面,亂碼就出現了.........
- Nov 11 Mon 2013 11:51
-
Oracle如何檢核空字串(How to compare a VARCHAR2 variable, which is an empty value?)
上星期遇到的情況,當測試資料也建好了,就很直覺下了一個SQL語法去檢核該條件欄位是不是空的?
SQL> SELECT * FROM TXN FROM USERDATE != ''
結果卻找不到任何資料!當下覺得怎麼會這樣,明明資料才建好,不加條件就找得到資料。只好看文件找解答,最後的結果是
Oracle doesn't differentiate between empty strings and NULL, Use the IS NULL syntax to check if variable is an empty string.
SQL> SELECT * FROM TXN FROM USERDATE != ''
結果卻找不到任何資料!當下覺得怎麼會這樣,明明資料才建好,不加條件就找得到資料。只好看文件找解答,最後的結果是
Oracle doesn't differentiate between empty strings and NULL, Use the IS NULL syntax to check if variable is an empty string.
- Oct 02 Wed 2013 14:30
-
Visual Source Safe Integration with IntelliJ IDEA Community Edition
本來一直都用 Eclipse 來開發 java ,想說 Google 把開發 Android 的 IDE 改成 IDEA ,那就來試試 IDEA 好不好用,興沖沖的下載安裝完成後,準備連接 VSS 下載專案程式,卻發現 IDEA 的 Version Control System 裡面根本沒有 VSS 選項,只好上 IDEA 的官網查一下,沒想到是個讓人蠻沮喪的答案...
VSS integration is available in Ultimate Edition only: http://www.jetbrains.com/idea/features/editions_comparison_matrix.html
VSS integration is available in Ultimate Edition only: http://www.jetbrains.com/idea/features/editions_comparison_matrix.html




















































