<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3366779500719343684</id><updated>2024-09-07T16:15:38.694+08:00</updated><category term="zk"/><category term="java"/><category term="Documentum"/><category term="hibernate"/><category term="家庭"/><category term="工作"/><category term="SAP"/><category term="spring"/><category term="信仰"/><category term="MySQL"/><category term="WebDynpro"/><category term="ajax"/><category term="javascript"/><category term="software engineering"/><category term="web"/><category term="技術支援與顧問"/><category term="browser"/><category term="eclipse"/><category term="html"/><category term="maven"/><category term="mindmap"/><category term="software"/><category term="struts"/><category term="tomcat"/><title type='text'>無垠天際</title><subtitle type='html'>飛向真理，過得勝的生活</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://hawkphoenix.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://hawkphoenix.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Hawk</name><uri>http://www.blogger.com/profile/13630962980859833141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>102</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3366779500719343684.post-7245427339677165002</id><published>2022-06-17T09:29:00.001+08:00</published><updated>2022-06-17T22:25:31.246+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="技術支援與顧問"/><title type='text'>有時你得靠問問題來回答問題</title><summary type="text">


Photo by rawpixel.com from Pexels
技術顧問看似應該要回答客戶各種技術問題，但我發現問對問題才能幫助你更好的回答問題。
客戶未提供必要資訊
某天去了一家從未去過的麵店，因為趕時間看一眼菜單就點「乾麵加蛋」，付款時發現店員可能聽成「麵加蛋」，因此做成「外帶、肉羹麵加蛋」，跟我預期的完全不同。我的確是忘了說我要「內用」，店員如果只聽到我點「麵」，而店裡提供兩種麵，要避免做錯，他應該要問我：

肉羹麵還是乾麵？
外帶還是內用？

其實客戶未提供必要資訊是可以理解的，因為面對不了解的領域，無法分辨哪些資訊是必要提供的。另外，有些客戶也會基於一種「你應該要能解決我問題」的心態，希望直接把問題丟給你解決。

提問是種專業
技術支援上經常遇到這種情形，客戶通常不會提供他所遇到的問題的完整或必要的資訊，甚至只會說「頁面不會動」這種很籠統的描述。因此我們要根據每個不同</summary><link rel='replies' type='application/atom+xml' href='http://hawkphoenix.blogspot.com/feeds/7245427339677165002/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3366779500719343684/7245427339677165002' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/7245427339677165002'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/7245427339677165002'/><link rel='alternate' type='text/html' href='http://hawkphoenix.blogspot.com/2019/08/blog-post_20.html' title='有時你得靠問問題來回答問題'/><author><name>Hawk</name><uri>http://www.blogger.com/profile/13630962980859833141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheMeAuYy0JSNvUCYz4aYmTnZfhy_NJZz17G8DJjiXtljTE8P3IUV2g-7KFyyNLYwXjy8UD-a3w5z_waMuDDwoeZ6NmhsuMJXJ03iIn8qsWAKWRGs4EggkhwOT6mD7tb-6Sj4F-8m3mT9I/s72-c/ask.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366779500719343684.post-8119334570178502644</id><published>2022-06-11T21:52:00.002+08:00</published><updated>2022-06-15T09:06:29.981+08:00</updated><title type='text'>把事做好，不能只靠能力</title><summary type="text">&amp;nbsp;
今年重新整修廚房，遇到了三個問題，都是櫥櫃安裝師傅的錯誤態度造成的。
犯錯不承認
在安裝水槽、水龍頭時，需要先關閉家中水塔的供水，這位師傅關了一次沒成功，又再去關第二次，待他安裝完離開後，我們發現家中水壓變得異常的小。我初步判斷跟師傅關閉水塔管路非常相關，因為在這之前都很正常，但是我們向師傅反應時，他卻說他只有開關管路而已，並沒動到其他部分，並說我們家水壓本來就比較小。言下之意是說跟他沒關係，不是他造成的。但是當天晚上我們反覆測試與確認，認為還是跟開關水塔管路有關。隔天還是知會設計公司派水電師傅來檢查，後來的確發現是櫥櫃師傅關錯水管線路造成。
不懂裝懂
到了安裝洗碗機門片時，櫥櫃師傅告知我們洗碗機額外附上的鐵片是避震用，但沒想到洗碗機原廠師傅來時，卻說那個額外的鐵片是用來安裝門片用的，因此櫥櫃師傅安裝方法不對。這令我們有點生氣，他完全不懂卻說得那麼篤定。
未事先準備
而安裝</summary><link rel='replies' type='application/atom+xml' href='http://hawkphoenix.blogspot.com/feeds/8119334570178502644/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3366779500719343684/8119334570178502644' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/8119334570178502644'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/8119334570178502644'/><link rel='alternate' type='text/html' href='http://hawkphoenix.blogspot.com/2022/06/blog-post.html' title='把事做好，不能只靠能力'/><author><name>Hawk</name><uri>http://www.blogger.com/profile/13630962980859833141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366779500719343684.post-868451635070058210</id><published>2022-02-03T23:30:00.002+08:00</published><updated>2022-02-04T23:25:41.308+08:00</updated><title type='text'>我的孩子不想努力，我怎麼從旁給力</title><summary type="text">先前發現老家有個被棄置的蛇板，覺得可惜就拿回來玩。但我覺得很難玩，連站都站不上去。但小女兒卻是興致盎然，很開心的一直試著滑，也邀請要好的鄰居女孩一起玩。我也覺得蛇板應該非常符合她的興趣。但是一兩週後的某天，突然發現她不玩了，我感覺應該不是玩膩了，因爲才剛拿到沒多久。而且不管是鄰居女孩或我找她一起玩，她就是不願意，問她原因也不說，只說就是不想玩了。
以我對她的了解，她應該會很喜歡蛇板，而且她剛開始看到蛇板明明很興奮，為何後來突然就不想玩了呢？我覺得小女兒很擅長戶外運動，我也希望能多多培養她這個專長，所以她不玩蛇板我覺得很可惜。但我也不可能威脅說：「去給我溜蛇板，不然我就要丟掉它」。因此我選擇接受她這個狀態，也不一直追問她原因。
我先嘗試以身作則的方法，就是每次跟小女兒在門口玩時，我就會花點時間練蛇板，也會上網看一些基本教學，慢慢從能先站上板子滑一小段，到漸漸可以滑行較長距離，後來更熟了之後</summary><link rel='replies' type='application/atom+xml' href='http://hawkphoenix.blogspot.com/feeds/868451635070058210/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3366779500719343684/868451635070058210' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/868451635070058210'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/868451635070058210'/><link rel='alternate' type='text/html' href='http://hawkphoenix.blogspot.com/2022/02/blog-post.html' title='我的孩子不想努力，我怎麼從旁給力'/><author><name>Hawk</name><uri>http://www.blogger.com/profile/13630962980859833141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/a/AVvXsEhdnTeWvat8-Wremo5-lTAm7nI0BcJ5NBgKsjztoteVZYHAa9bOx4_gGGrN8bOO9n37-7BxV7FZP-wMMF6JaElkMG0vxokbzrW82m8Ai1iQCaps-qWlY8yznrDFpoiHulG4hqo8-qMjnTiQUetz0zQtSrvzUxxoe9gaG-IE8aW0Fq2u3ct6m3CB-JR0=s72-c" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366779500719343684.post-2270927040674505917</id><published>2020-02-15T22:37:00.002+08:00</published><updated>2020-02-15T22:37:52.680+08:00</updated><title type='text'>jQuery event.namespace</title><summary type="text">最近才發現 jQuery event.namespace 可以讓你只移除自己註冊的 event listener 而不移除其他人註冊的。
往常我們多半指定 event type 來註冊：
$(document).bind(&#39;mouseup&#39;, myListener);

並指定同一個 event type 來移除：
$(document).unbind(&#39;mouseup&#39;);

但有時候你使用別人的 widget 或 library 也許它也註冊了同樣事件的 listener，或是你不確定有沒有，為了避免不小心 unbind 其他人的 listener，我可以在註冊加上 namespace 如：
$(document).bind(&#39;mouseup.line&#39;, myListener);

.line 就是自訂的命名空間。
然後可以移除該 namespace 的所有 listener：
$</summary><link rel='replies' type='application/atom+xml' href='http://hawkphoenix.blogspot.com/feeds/2270927040674505917/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3366779500719343684/2270927040674505917' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/2270927040674505917'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/2270927040674505917'/><link rel='alternate' type='text/html' href='http://hawkphoenix.blogspot.com/2020/02/jquery-eventnamespace.html' title='jQuery event.namespace'/><author><name>Hawk</name><uri>http://www.blogger.com/profile/13630962980859833141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366779500719343684.post-2637659260871441979</id><published>2020-02-12T17:49:00.001+08:00</published><updated>2020-02-12T17:50:03.345+08:00</updated><title type='text'>margin collapse 造成垂直捲動條</title><summary type="text">有次我發現即使我將 html, body 都設定沒有 margin 如：
html{
  height:100%;
  margin:0px;
}
body{
  height:100%;
  margin:0px;
}

但頁面仍然產生垂直捲動條(scrollbar)，檢查後發現 body 跟 text1 的上白邊合併，造成 body 向下移動，因為 body、html 高度相同，下移就造成右方垂直捲動條出現。

另一個例子：text1 的下白邊與 text2 的上白邊合併 (collapse)

這頁範例可以重現以上問題。
這不是 bug，而是規格上定義的 margin collapse： 8  Box model / 8.3.1  Collapsing margins
解法
 
&amp;lt;h1 style=&quot;display:inline-block&quot;&amp;gt;text 1&amp;lt;/h1</summary><link rel='replies' type='application/atom+xml' href='http://hawkphoenix.blogspot.com/feeds/2637659260871441979/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3366779500719343684/2637659260871441979' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/2637659260871441979'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/2637659260871441979'/><link rel='alternate' type='text/html' href='http://hawkphoenix.blogspot.com/2020/02/margin-collapse.html' title='margin collapse 造成垂直捲動條'/><author><name>Hawk</name><uri>http://www.blogger.com/profile/13630962980859833141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhO21cqE3uIZ2UWciPgj2ch2ImIOUSlJeDOl7QbtLEiGp5-JhAGnVCJkD2_whuUfbkKX504FVgVC4WDSBSq7ii3qXWTy-PBOj7DzrBgY4f4_K8bqwV1A_49sOM6VknD_IinjDE-IJUEMIQ/s72-c" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366779500719343684.post-4525508127147613163</id><published>2020-02-09T21:13:00.002+08:00</published><updated>2020-02-09T21:13:30.926+08:00</updated><title type='text'>ZK 與響應式網頁設計（RWD）</title><summary type="text">響應式網頁設計 (RWD)就現今而言應該是許多網站必備的條件之一，ZK 框架可以幫你從一個抽象層次較高的角度滿足 RWD，不需要了解 CSS Media Query 的細節。
元件層級
元件層級的 RWD 是由元件內部自動完成的。每個 ZK 元件都能區分瀏覽器的種類，因此會自動依據桌上型或行動裝置瀏覽器來自動調整元件的外觀，不需開發者介入，例如 datebox 在桌面瀏覽器會跳出小月曆：

在手機瀏覽器就會自動變成下方滾動條：

頁面層級
頁面層級的 RWD 因為牽涉到版面設計，因此無法靠元件自動完成，因為畢竟每個頁面需要的版面設計皆不相同，這通常不是一個技術性的決定，而是政策性或設計性上的決定，因此 ZK 提供一些工具讓你實現 RWD。以下根據你想要達成的效果，概述你可用的工具。
寬度、版面自動調整
如果你想要做出的效果是，畫面內各區域自動調整寬度，較窄時調整位置，我非常推薦搭配 </summary><link rel='replies' type='application/atom+xml' href='http://hawkphoenix.blogspot.com/feeds/4525508127147613163/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3366779500719343684/4525508127147613163' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/4525508127147613163'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/4525508127147613163'/><link rel='alternate' type='text/html' href='http://hawkphoenix.blogspot.com/2020/02/zk-rwd.html' title='ZK 與響應式網頁設計（RWD）'/><author><name>Hawk</name><uri>http://www.blogger.com/profile/13630962980859833141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhINsFQi5KwW3bjLGl1kvGgtFcNyoJk7QL61NgINh3CQkNrqLCh6_QJG54JHEArzzcZTgzPUnIhaPEUd3WetTh-GWAyPVmQJy7YQbPeBvGM9pcJKPanHsHNgHzsrz7XcWe8jwfdis8Cr28/s72-c" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366779500719343684.post-7363110810443877883</id><published>2020-01-11T17:39:00.002+08:00</published><updated>2020-01-11T17:39:17.884+08:00</updated><title type='text'>innerHTML 的安全風險</title><summary type="text">問題
若你要實作一個使用者輸入的功能，並把輸入的內容顯示在網頁上時，應避免把使用者輸入的值直接指定給某個 element 的 innerHTML。因為若是使用者輸入包含 HTML、JavaScript，innerHTML就會解析並執行：
var userInput = &#39;&amp;lt;img src=&quot;javascript:alert(&quot;XSS&quot;)&quot;&amp;gt;&#39;
element.innerHTML = userInput;

因此可能 user A 的惡意輸入，會被系統顯示到 user B 的畫面上，進而執行特定成程式碼而造成 XSS 攻擊。
解法
一般會先想到 encode HTML，但是如果只是要顯示文字，將使用者輸入值指定給 textContent 會更簡單，無需 encode，該值會被當成純文字處理，並不會執行 javascript。
var userInput = &#39;&amp;lt;img </summary><link rel='replies' type='application/atom+xml' href='http://hawkphoenix.blogspot.com/feeds/7363110810443877883/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3366779500719343684/7363110810443877883' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/7363110810443877883'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/7363110810443877883'/><link rel='alternate' type='text/html' href='http://hawkphoenix.blogspot.com/2020/01/innerhtml.html' title='innerHTML 的安全風險'/><author><name>Hawk</name><uri>http://www.blogger.com/profile/13630962980859833141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366779500719343684.post-5657651994285180716</id><published>2019-12-18T07:53:00.001+08:00</published><updated>2019-12-18T07:53:34.617+08:00</updated><title type='text'>Mac 藍芽無法使用問題 (not available)</title><summary type="text">最近開始用藍芽，發現 Mac 一旦休眠之後藍芽就會不能使用，變成關閉狀態:

或是顯示 Bluetooth Not Available
即使到設定畫面， 啟動藍芽(turn bluetooth on) 的按鈕也是 disabled 無法點。
必須要重開機
網路上有提到許多解法，但比較少提到的是如果你曾安裝 Android File Transfer 就會有此問題，解決方法只有移除一途，我就遇到這個情形，已驗證過，的確可以解決。這篇文章有提到。

</summary><link rel='replies' type='application/atom+xml' href='http://hawkphoenix.blogspot.com/feeds/5657651994285180716/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3366779500719343684/5657651994285180716' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/5657651994285180716'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/5657651994285180716'/><link rel='alternate' type='text/html' href='http://hawkphoenix.blogspot.com/2019/12/mac-not-available.html' title='Mac 藍芽無法使用問題 (not available)'/><author><name>Hawk</name><uri>http://www.blogger.com/profile/13630962980859833141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAisYKJMCHPL5UYZ5obaS_MWhhyphenhyphen4n1T2zqUxS3KNqsRqQ1H_8QcArbAqZWeDc9rfbaSm1hGiDVrNDGB9q6c6YzmfD1x1HiPB4cYJoaGaZZ20E2Aq1ARI0_Uwek-6gpJ-hDHbfqkSlLXKE/s72-c" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366779500719343684.post-7138604029633659574</id><published>2019-10-06T23:40:00.001+08:00</published><updated>2019-12-18T07:55:34.065+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="技術支援與顧問"/><title type='text'>避免落入預期解法的死胡同</title><summary type="text">



買錯票
某天我要去台北，卻發現自己前一天起迄站買反，買成台北 —&amp;gt; 台南，但是搭車前才發現，詢問服務台人員，只得到回覆說發車前 30 分之前才能退票，自己也依稀記得規定是如此，因此只好認栽，誰叫自己買票沒看清楚，趕緊自己去重買一張到台北的車票。後來老婆提醒我也許可以換票，再至服務台詢問，服務小姐說若是錯過班車，可以當天的票搭乘較晚班次的自由座，但是我給她看我的票是早上出發，卻要搭晚上的車，我就解釋是因為我買錯票，她猶豫了一下，竟然說了一個聽起來可以幫我換票的說詞（我忘了他確切的用詞），我雖然感到驚訝但是我已經買了到台北的票，只能說來不及了，她就建議我仍然採用換搭自由座的方法。

預期解法 - 退票
這件事我也犯了一個跟某些客戶常犯的錯誤，就是「沒有提供背景資訊」，或說「預期解法」。我心理預期我的問題的解法只有「退票」，因此我只問了特定的「退票」事宜，發現不能用「退票」解決，</summary><link rel='replies' type='application/atom+xml' href='http://hawkphoenix.blogspot.com/feeds/7138604029633659574/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3366779500719343684/7138604029633659574' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/7138604029633659574'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/7138604029633659574'/><link rel='alternate' type='text/html' href='http://hawkphoenix.blogspot.com/2019/08/blog-post.html' title='避免落入預期解法的死胡同'/><author><name>Hawk</name><uri>http://www.blogger.com/profile/13630962980859833141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAKu_h832xqhoeLE77o8lTT-D3ttOcLPYaIPCyjQESR4TnMG9uE-gKepZFE5VeKuK-V1UyJQDBUf5chHkrfrktZIFgvBZ06k8eJ1uMGEitIHjUUOeb2GQTjpUToDrMob_IH-dB9DdmUoI/s72-c/end-on-road.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366779500719343684.post-3786734197579027752</id><published>2019-08-13T20:02:00.002+08:00</published><updated>2019-08-13T20:02:32.247+08:00</updated><title type='text'>[Tomcat] 自動部署</title><summary type="text">問題
如果 WAR 檔很大，部署的時候，解壓縮 WAR 如果需要 30 秒，這段時間應用程式就會停止服務。
解法
減少部署過程中 ，應用程式無法服務的時間。
undeployOldVersions
https://tomcat.apache.org/tomcat-8.0-doc/config/host.html
war naming
http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Naming
綜合以上兩種設定，我們可以在已經部署
myapp.war
的情況下，再部署新版
myapp##2.war
待新版部署完畢，Tomcat 就會自動移掉舊版。

</summary><link rel='replies' type='application/atom+xml' href='http://hawkphoenix.blogspot.com/feeds/3786734197579027752/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3366779500719343684/3786734197579027752' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/3786734197579027752'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/3786734197579027752'/><link rel='alternate' type='text/html' href='http://hawkphoenix.blogspot.com/2019/08/tomcat.html' title='[Tomcat] 自動部署'/><author><name>Hawk</name><uri>http://www.blogger.com/profile/13630962980859833141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366779500719343684.post-4008633209187866062</id><published>2019-04-07T22:25:00.002+08:00</published><updated>2019-04-07T22:25:44.506+08:00</updated><title type='text'>Chrome 放棄請求</title><summary type="text">有人遇到 Chrome 放棄 (abort) ajax 請求 (request)  的狀況，但原因不明。只知道 XMLHttpRequestEventTarget.onabort 被呼叫了。
有人查了 Chrome 的程式碼與也有人歸納自己的經驗，發現有以下幾種情形 Chrome 會放棄請求:
發出請求的 DOM 元素已經被刪叫
例如說 &amp;lt;img&amp;gt; 將要載入圖片，但在載入發生之前，&amp;lt;img&amp;gt; 就被刪掉了。
做了某件事造成不需要該請求
例如載入一個 iframe，但卻改變 src 屬性，因此原本要載入的內容就不需要了。
多個請求中的第一個失敗了
架設有多個請求陸續發到同一個伺服器，先發的某個請求因為網路問題失敗了，例如 DNS 錯誤、400 等，那後續的請求就會被取消
Self-signed certificate 不被 android Chrome 信任
你發出</summary><link rel='replies' type='application/atom+xml' href='http://hawkphoenix.blogspot.com/feeds/4008633209187866062/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3366779500719343684/4008633209187866062' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/4008633209187866062'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/4008633209187866062'/><link rel='alternate' type='text/html' href='http://hawkphoenix.blogspot.com/2019/04/chrome.html' title='Chrome 放棄請求'/><author><name>Hawk</name><uri>http://www.blogger.com/profile/13630962980859833141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366779500719343684.post-2301693363989741491</id><published>2019-03-23T21:04:00.001+08:00</published><updated>2019-03-23T21:04:56.462+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="maven"/><title type='text'>[Maven] 增加建構 (build) 過程的資訊到 Manifest 中</title><summary type="text">自動產生建構相關的資訊
在部署到伺服器後，有時會弄不清楚這個到底是根據哪一個 commit 發布的、何時發布的、某個函示庫使用哪個版本，或是

不想一直修改版號，想要用發布時間代替版號
頻繁的部署到伺服器，甚至部署到不同的伺服器，你想知道目前這個伺服器上目前到底是哪一版、或執行哪個 commit 的 code

這時你可以把建構過程的資訊加入 manifest 中，再由程式讀出來顯示在適合的地方。
用 buildnumber 產生 git commit, git 分支 (branch) 等資訊
&amp;lt;plugin&amp;gt;
    &amp;lt;groupId&amp;gt;org.codehaus.mojo&amp;lt;/groupId&amp;gt;
    &amp;lt;artifactId&amp;gt;buildnumber-maven-plugin&amp;lt;/artifactId&amp;gt;
    &amp;lt;version</summary><link rel='replies' type='application/atom+xml' href='http://hawkphoenix.blogspot.com/feeds/2301693363989741491/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3366779500719343684/2301693363989741491' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/2301693363989741491'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/2301693363989741491'/><link rel='alternate' type='text/html' href='http://hawkphoenix.blogspot.com/2019/03/maven-build-manifest.html' title='[Maven] 增加建構 (build) 過程的資訊到 Manifest 中'/><author><name>Hawk</name><uri>http://www.blogger.com/profile/13630962980859833141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366779500719343684.post-7114247642649349578</id><published>2019-03-16T22:49:00.002+08:00</published><updated>2019-03-16T22:49:47.924+08:00</updated><title type='text'>testcafe 除錯</title><summary type="text">某次用 testcafe 測試時，呼叫某個 library 的函數後，整個瀏覽器就沒反應，也無錯誤訊息，完全無法得知發生何事。
這時只好追蹤進該函數才能知道發生何事，以下兩個參數可以啟用 node.js server 端的除錯器：
testcafe --inspect --debug-brk chrome ./test.ts
參考 All the tricks that help you debug TestCafe tests
只要在程式碼中寫下
debugger;
該除錯器就會幫你停在那ㄧ行，接下來你就可單步執行去找問題。
最後發現是 Promise 中的 lambda function 內有錯誤：
fs.copyFileSync 是 undefined，因為從 node 8.5.0 之後才存在該函數。
後來發現這兩個參數其實是 node.js 的除錯參數，看來 testcafe </summary><link rel='replies' type='application/atom+xml' href='http://hawkphoenix.blogspot.com/feeds/7114247642649349578/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3366779500719343684/7114247642649349578' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/7114247642649349578'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/7114247642649349578'/><link rel='alternate' type='text/html' href='http://hawkphoenix.blogspot.com/2019/03/testcafe_16.html' title='testcafe 除錯'/><author><name>Hawk</name><uri>http://www.blogger.com/profile/13630962980859833141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366779500719343684.post-2515771851662791112</id><published>2018-12-24T23:38:00.001+08:00</published><updated>2018-12-25T07:35:25.404+08:00</updated><title type='text'>2018 台灣領袖高峰會心得 - 面對失敗</title><summary type="text">
幾乎每個講者都提到失敗。

對個人來說，不要害怕失敗，要勇敢面對，甚至要把失敗當做養分，當作天然資源一樣運用，從中我們可以學習、並改進，進而成長。不要把失敗當做是對自己的否定，那只是你人生中必然會出現的一種狀況。


一個例子

我想到前陣子一個發生在我自己身上的事。

某次我在試用公司產品時，發現了一個缺陷，回報給產品團隊時，他們卻說他們那邊無法重現這個問題，但我這邊卻能很明確用幾個步驟產生該缺陷。我與同事花了不少時間找原因，比較我跟產品團隊的環境差別，後來才突然發現我電腦上的客戶端程式與產品伺服器版本不同，因此連線上產品伺服器去操作的時候才會產生該缺陷，然而必須要使用客戶端程式與產品伺服器相同版本才能正確運作。

剛發現原因的時候，又陷入過往錯誤的思考模式，開始否定自己，覺得丟臉，感覺是自己犯了愚蠢的錯誤，弄錯版本給同事找麻煩。過了一會，冷靜一想，其實使用者操作的時候看不出伺服器</summary><link rel='replies' type='application/atom+xml' href='http://hawkphoenix.blogspot.com/feeds/2515771851662791112/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3366779500719343684/2515771851662791112' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/2515771851662791112'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/2515771851662791112'/><link rel='alternate' type='text/html' href='http://hawkphoenix.blogspot.com/2018/12/2018.html' title='2018 台灣領袖高峰會心得 - 面對失敗'/><author><name>Hawk</name><uri>http://www.blogger.com/profile/13630962980859833141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNhbcjfEESKlN3AWEgAaZ7AkmBCoJRNO4vkCOmkpRceSYaqfKzNhkvTUehua7vWGrRyiaIBXTgYUZTmYtIJ98bG4f2rH-dD4siS7du1svO9vNXmxGCdyZaAQ_ra5UnkyhNMZYIvfkd7Cs/s72-c" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366779500719343684.post-1672178521815438101</id><published>2018-03-18T16:05:00.001+08:00</published><updated>2019-03-23T21:06:16.761+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="zk"/><title type='text'>ZK 教學 - 常見錯誤用法 06 - 慎選 data binding 語法</title><summary type="text">
慎選 data binding 語法
最常用的語法有以下 4 種：

@init： 只從 ViewModel 載入一次
@load：載入並追蹤 ViewModel 變化
@save：寫入 ViewModel1
@bind：（雙向）等於 @load + @save

後面 3 種因為需要持續維持（追蹤）元件與 ViewModel 的綁定關係，伺服器需要建立 tracking node，因此成本較高。
依對系統的負擔排名如下：

因此如果沒有動態變化的需要，請使用 @init。
例如在 Listbox, Grid, Tree內的 &amp;lt;template&amp;gt;若只是顯示資料，只需用 @init，可以免去大量 tracking node 所需的記憶體。
例如：
&amp;lt;grid width=&quot;400px&quot; model=&quot;@init(vm.itemList)&quot;&amp;gt;
     &amp;lt;</summary><link rel='replies' type='application/atom+xml' href='http://hawkphoenix.blogspot.com/feeds/1672178521815438101/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3366779500719343684/1672178521815438101' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/1672178521815438101'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/1672178521815438101'/><link rel='alternate' type='text/html' href='http://hawkphoenix.blogspot.com/2018/03/zk-06-data-binding_16.html' title='ZK 教學 - 常見錯誤用法 06 - 慎選 data binding 語法'/><author><name>Hawk</name><uri>http://www.blogger.com/profile/13630962980859833141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLfdLmN6mfeX2U4yec1wzVQCeHZD1_M9yJAs31y5smH7owqRZOm2I43jG54E6Gq0uhBf5hfpFnfAmXeFYKPlGvx2bd0NdJQznHCcbGox4vxtXUwl2DAKtFK5k3fUvDSq3nXto65V7v6_U/s72-c" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366779500719343684.post-6376168410473780508</id><published>2018-01-16T22:56:00.002+08:00</published><updated>2018-01-16T22:56:39.587+08:00</updated><title type='text'>將 Atom 作為 markdown 編輯器</title><summary type="text">如果要將 Atom 作為 markdown 編輯器的話，本身已經內建預覽功能 （ctrl+shift+m），再加上以下兩個套件會更方便：

markdown-scroll-sync
捲動原始檔案時，預覽畫面也會跟著捲動。
markdown-writer 增加熱鍵插入 markdown 語法，如 cmd+shift+’ 插入 code block。安裝完後，要先選 Packages / Markdown Writer / Configurations / Create Default Keymaps，熱鍵才會作用。


</summary><link rel='replies' type='application/atom+xml' href='http://hawkphoenix.blogspot.com/feeds/6376168410473780508/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3366779500719343684/6376168410473780508' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/6376168410473780508'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/6376168410473780508'/><link rel='alternate' type='text/html' href='http://hawkphoenix.blogspot.com/2018/01/atom-markdown.html' title='將 Atom 作為 markdown 編輯器'/><author><name>Hawk</name><uri>http://www.blogger.com/profile/13630962980859833141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366779500719343684.post-2086583131032927840</id><published>2018-01-02T11:01:00.001+08:00</published><updated>2018-01-02T11:02:01.381+08:00</updated><title type='text'>Intellij IDEA java 在 mac 下除錯模式啟動特別慢（卡住）</title><summary type="text">使用 Intellij 時，很常需要用除錯 (debug) 模式執行一個程式，但我發現在 Mac 下每次啟動都會卡住整個 Intellij 好幾秒鐘（完全無法操作），然後才會啟動，非常影響除錯效率，近來終於找到 stackoverflow 上有人提供的解法：可以透過修改 /ect/hosts 或是啟動 File Sharing 來解決。</summary><link rel='replies' type='application/atom+xml' href='http://hawkphoenix.blogspot.com/feeds/2086583131032927840/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3366779500719343684/2086583131032927840' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/2086583131032927840'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/2086583131032927840'/><link rel='alternate' type='text/html' href='http://hawkphoenix.blogspot.com/2018/01/intellij-idea-java-mac.html' title='Intellij IDEA java 在 mac 下除錯模式啟動特別慢（卡住）'/><author><name>Hawk</name><uri>http://www.blogger.com/profile/13630962980859833141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366779500719343684.post-5622654508325300604</id><published>2017-10-24T23:05:00.001+08:00</published><updated>2017-10-24T23:05:51.758+08:00</updated><title type='text'>Inkscape 在 Mac 下只能輸入注音文問題</title><summary type="text">當我在 Mac (Sierra 10.12) 中使用 Inkscape 時，發現不管怎麼打字都只會出現注音文，如： 
ㄅㄨㄛ

既不能輸入英文，也不能打出中文字。我沒有完全解決，但是以下我的設定至少可以讓我輸入英文，中文輸入則必須要從其他應用程式複製後貼過來，給大家參考： 


</summary><link rel='replies' type='application/atom+xml' href='http://hawkphoenix.blogspot.com/feeds/5622654508325300604/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3366779500719343684/5622654508325300604' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/5622654508325300604'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/5622654508325300604'/><link rel='alternate' type='text/html' href='http://hawkphoenix.blogspot.com/2017/10/inkscape-mac.html' title='Inkscape 在 Mac 下只能輸入注音文問題'/><author><name>Hawk</name><uri>http://www.blogger.com/profile/13630962980859833141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366779500719343684.post-1414516148494249051</id><published>2017-10-24T22:43:00.001+08:00</published><updated>2017-10-24T22:45:11.087+08:00</updated><title type='text'>如何同時在多個 Excel 工作表 (sheet) 編輯</title><summary type="text">如果你有多個工作表 (sheet)，你想要：


在每個表上的同一個儲存格中輸入一樣的內容、設定同樣的格式
在每個表上的同一個欄位上插入一行
刪除每個表上的同一個欄位


以上需求一開始你可能會想說用複製貼上，每一個表都做一次，但是這樣很麻煩也容易出錯，其實有方法可以一次作用在多個工作表上，只要：


先選擇要操作的所有工作表。可按住 Ctrl 選擇不連續的多個工作表或按住 Shift 選擇連續的多個工作表。
在某個工作表執行你要的動作如：插入行、輸入文字等


這樣該動作就會作用在所有你所選的工作表上。</summary><link rel='replies' type='application/atom+xml' href='http://hawkphoenix.blogspot.com/feeds/1414516148494249051/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3366779500719343684/1414516148494249051' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/1414516148494249051'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/1414516148494249051'/><link rel='alternate' type='text/html' href='http://hawkphoenix.blogspot.com/2017/10/excel-sheet.html' title='如何同時在多個 Excel 工作表 (sheet) 編輯'/><author><name>Hawk</name><uri>http://www.blogger.com/profile/13630962980859833141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366779500719343684.post-4342453687468493186</id><published>2017-09-05T22:55:00.001+08:00</published><updated>2019-03-23T21:06:41.800+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="tomcat"/><title type='text'>Tomcat 如何自動停用（不部署）應用程式 war 檔</title><summary type="text">一般要停止一個應用程式可以透過 Tomcat GUI 管理介面停用： 
http://localhost:8080/manager/html
但是如果你希望啟動時就不要部署 (deploy) 某個應用程式 war 檔，就無法透過 GUI 管理介面。
例如： 
我有一個應用程式部署了好幾個版本 app01.war 、 app02.war，但是我希望啟動 Tomcat 時，只要部署 app02.war ，而 app01.war 不要被自動解開部署。這時可以採用以下設定：
conf/server.xml
&amp;lt;Host deployIgnore=&quot;app01.war&quot; &amp;gt;
細節請參考: http://tomcat.apache.org/tomcat-7.0-doc/config/host.html#UserWebApplications</summary><link rel='replies' type='application/atom+xml' href='http://hawkphoenix.blogspot.com/feeds/4342453687468493186/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3366779500719343684/4342453687468493186' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/4342453687468493186'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/4342453687468493186'/><link rel='alternate' type='text/html' href='http://hawkphoenix.blogspot.com/2017/09/tomcat-war.html' title='Tomcat 如何自動停用（不部署）應用程式 war 檔'/><author><name>Hawk</name><uri>http://www.blogger.com/profile/13630962980859833141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366779500719343684.post-2252066305021421728</id><published>2017-07-30T18:22:00.001+08:00</published><updated>2017-07-30T20:44:19.040+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="zk"/><title type='text'>用 ZK shadow component 實現更彈性的頁面控制 - JCConf 2016 演講</title><summary type="text">很開心有機會能在 JCConf 2016 上演講，講題是「用 ZK shadow component 實現更彈性的頁面控制」。Shadow Component 我認為是 ZK 8 最重要的功能，讓你模組化一個頁面片段（含有一群 UI 元件），允許你傳參數至該頁面，因此可以輕易地在不同頁面內重用該頁面片段。

例如你用幾個元件組合出如下的個人資料圖: 


你可以將該群元件放在一個獨立的 zul 中，在任一個頁面中將其插入，也可以設定一個易讀的元件名稱，所以在 zul 中就可以類似這樣使用：

&amp;lt;zk&amp;gt;
    &amp;lt;personbox person=&quot;@init(vm.person)&quot;&amp;gt;
&amp;lt;/zk&amp;gt;

配合 ListModelList 跟 &amp;lt;forEach&amp;gt; (shadow component) 就可以做到動態增減的效果： 


完整介紹請看</summary><link rel='replies' type='application/atom+xml' href='http://hawkphoenix.blogspot.com/feeds/2252066305021421728/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3366779500719343684/2252066305021421728' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/2252066305021421728'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/2252066305021421728'/><link rel='alternate' type='text/html' href='http://hawkphoenix.blogspot.com/2017/07/zk-shadow-component-jcconf-2016.html' title='用 ZK shadow component 實現更彈性的頁面控制 - JCConf 2016 演講'/><author><name>Hawk</name><uri>http://www.blogger.com/profile/13630962980859833141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPt0B7Bl6WLac6dS_feA-J4-JWFC7sKkQHjL_DOiiI0xmFZ_o904FwS-BgOVhkuaVIUwu5pQEDW9zK79clAFLAa8YFz7nawR4Lcn68RKPjVsPwkA984shY2TjbQ7rCNWT355TH4GRdMfA/s72-c/personBox.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366779500719343684.post-3076157614913734648</id><published>2017-07-20T16:47:00.001+08:00</published><updated>2017-07-20T16:47:50.892+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="zk"/><title type='text'>Visual Editor 的替代方案 Run-jetty-run</title><summary type="text">ZK Studio 是幫助你開發 ZK 程式的一個 eclipse plugin，原本附帶一個 zul 頁面預覽功能叫 Visual Editor，目前已經被拆開需要額外下載安裝。不過因為已經沒有繼續維護，你若使用較新版的 eclipse Visual Editor 可能無法正常執行。

因此推薦各位安裝另一個 eclipse plugin: run-jetty-run。它有幾個優點：


快速啟動 
它可以直接在 eclipse 中將你的專案用 jetty 這個輕量的 application server 跑起來，過程只需要幾秒鐘，也不需要打包你的專案成 WAR。
熱抽換 Java class 
開發過程中更改 Java class 也不需要重新啟動，它會自動載入最新編譯的 bytecode
自動關閉前一台 
如果再啟動一次 jetty  （不管是相同或不同專案），它會自動先幫你把前次</summary><link rel='replies' type='application/atom+xml' href='http://hawkphoenix.blogspot.com/feeds/3076157614913734648/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3366779500719343684/3076157614913734648' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/3076157614913734648'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/3076157614913734648'/><link rel='alternate' type='text/html' href='http://hawkphoenix.blogspot.com/2017/07/visual-editor-run-jetty-run.html' title='Visual Editor 的替代方案 Run-jetty-run'/><author><name>Hawk</name><uri>http://www.blogger.com/profile/13630962980859833141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366779500719343684.post-3895954109535519914</id><published>2017-06-05T22:03:00.001+08:00</published><updated>2017-06-05T22:03:33.270+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="zk"/><title type='text'>ZK 教學 - 使用 MVC 或 MVVM?</title><summary type="text">不管是現在剛開始接觸 ZK 或是用過一陣子的人都可能會遇到的問題是到底要用 MVC 或 MVVM 的方式開發。從 ZK 8 之後又把 MVVM 的能力更佳的擴展，所以 MVVM 會是一個功能更強的開發方式。但 MVC 在使用上比較直覺，仍有其優勢，所以我想決定性的因素會比較是開發者的偏好及專案的特性。你可參考下面的比較來決定哪種方式比較適合你。



優勢比較



MVVM


ViewModel 較不易受畫面變動影響。 
因為 ViewModel 沒有變數直接指向 ZK 元件，因此若是畫面上有元件更改，ViewModel 一般不需要修改
ViewModel 較易於在不同頁面中重用。 
因為 ViewModel 只包含資料跟業務邏輯，若是不同頁面需要的資料跟業務邏輯相同，就可以重用同一個 ViewModel
例如 A 頁面按按鈕執行搜尋，B 頁面點選單執行同樣的搜尋，則可以重用同一個 </summary><link rel='replies' type='application/atom+xml' href='http://hawkphoenix.blogspot.com/feeds/3895954109535519914/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3366779500719343684/3895954109535519914' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/3895954109535519914'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/3895954109535519914'/><link rel='alternate' type='text/html' href='http://hawkphoenix.blogspot.com/2017/06/zk-mvc-mvvm.html' title='ZK 教學 - 使用 MVC 或 MVVM?'/><author><name>Hawk</name><uri>http://www.blogger.com/profile/13630962980859833141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366779500719343684.post-3426406075027704132</id><published>2017-06-05T19:42:00.001+08:00</published><updated>2018-06-16T22:40:12.351+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="zk"/><title type='text'>ZK 教學中文書 - ZK 教練</title><summary type="text">2016年開始做了不少場教育訓練，覺得台灣工程師應該會蠻希望有一本中文的教材，因為目前網路上多是零散的文章，英文的文件雖然完整，但是太龐大，大部分的人應該無從下手。因此最近開始撰寫一本教學書：「 ZK 教練」（書名是老婆提供的點子），也為自己在這份工作推出一個代表作。
本書會包含以下幾個特點，幫助讀者更有效地學習：

範例專案 
本書附帶一個範例專案，裡面包含所有書中提到的範例程式。你可以輕易地將整個專案執行在 jetty 上，透過瀏覽器看到執行結果，有助於了解程式碼。
練習專案 
執行 maven 指令可以產生一個練習專案，它以範例專案為基礎，但是刻意移除部分程式碼，好讓讀者練習之用。因此你可以產生範例專案來練習，若真的遇到困難再參考完整程式。
圖片解說 
儘量以各式圖片解說概念。我認同 Head First Design Pattern 一書中提及的理念，學習不是只能靠文字，其他的</summary><link rel='replies' type='application/atom+xml' href='http://hawkphoenix.blogspot.com/feeds/3426406075027704132/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3366779500719343684/3426406075027704132' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/3426406075027704132'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/3426406075027704132'/><link rel='alternate' type='text/html' href='http://hawkphoenix.blogspot.com/2017/06/zk-zk.html' title='ZK 教學中文書 - ZK 教練'/><author><name>Hawk</name><uri>http://www.blogger.com/profile/13630962980859833141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366779500719343684.post-5974723558115406202</id><published>2016-11-30T15:17:00.001+08:00</published><updated>2017-10-25T22:05:08.934+08:00</updated><title type='text'>disabled 元素 (element) 跟 滑鼠事件 (click event) 的問題</title><summary type="text">照 W3C HTML5 規格 :
4.10.19.5 Enabling and disabling form controls: the disabled attribute

A form control that is disabled must prevent any click events that are queued on the user interaction task source from being dispatched on the element.&amp;nbsp;


disabled element 本身不會發出 click event ，而多數瀏覽器會把這事件往父元素送，但 firefox 不會（這個行為似乎沒有規格），因此要注意。
    &amp;lt;div onClick=&quot;console.log(event.target)&quot;&amp;gt;
        &amp;lt;</summary><link rel='replies' type='application/atom+xml' href='http://hawkphoenix.blogspot.com/feeds/5974723558115406202/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3366779500719343684/5974723558115406202' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/5974723558115406202'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366779500719343684/posts/default/5974723558115406202'/><link rel='alternate' type='text/html' href='http://hawkphoenix.blogspot.com/2016/11/disabled-element-click-event.html' title='disabled 元素 (element) 跟 滑鼠事件 (click event) 的問題'/><author><name>Hawk</name><uri>http://www.blogger.com/profile/13630962980859833141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>