網路科技

Google App Engine (1)

商業,創業,業務,職涯,美食,葡萄酒,閱讀,網路科技。

從 Larry 創業以及商業的經驗,希望以白話的口吻,介紹給大家這個商業的世界。

FB粉專會頻繁地更新 Larry 對於商業、社會、人生的觀察與心得,歡迎大家追蹤互動~

一般所謂的雲端服務分為 SaaS (Software as a Service),PaaS (Platform as a Service),和 IaaS (Infrastructure as a Service)。而本篇主角 Google App Engine 則是 PaaS 的代表之一。https://developers.google.com/appengine/training/intro/whatisgae

這兩天抽空將 GAE (Google App Engine) 的流程走了一遍,包含佈署 (deploy) 上線。https://developers.google.com/appengine/docs/java/gettingstarted/

專案資料夾主要分為 src 與 war。src 當然就是放你的原始碼,war 資料夾在最終會上傳佈署,其中包含:css、html、xml、jsp、多媒體資源檔、compiled byte-code,和相依的 jar libraries。

Eclipse “Web Application Project” 模版 “war” folder 裡 “index.html” 為網站的入口頁面。

“warWEB-INF” 裡的 “web.xml” 為 “web application deployment descriptor”。其宣告了 <servlet>,<servlet-mapping>,和 <welcome-file-list>。

<welcome-file-list> 的 default 值是 “index.html”。根據:
https://developers.google.com/appengine/docs/java/gettingstarted/creating

“It also says that, whenever the user fetches a URL path that is not already mapped to a servlet and represents a directory path inside the application's WAR, the server should check for a file named index.html in that directory and serve it if found.”

另外還有一 “appengine-web.xml”,則是 GAE 專屬,其 <application> 標籤是重點,須與你的 GAE application ID 同。指定 JSP 網頁的方式:
https://developers.google.com/appengine/docs/java/gettingstarted/usingjsps

開發過程主要就是新增 JSP 檔和在 “web.xml” 指定你 JSP 檔的 mapping URL。當然 JSP 檔可以跟 Java servlet 做互動。

GAE 提供了免費 (或是一定費用) 的虛擬 server,免去採購 server,設定 server,建置維護網站運行環境所需的人力與金錢。

附註:GAE 目前還不成熟,tool chain 的建置不是很順暢,很多東西要 google 一陣子才知道做法。

商業,創業,業務,職涯,美食,葡萄酒,閱讀,網路科技。

從 Larry 創業以及商業的經驗,希望以白話的口吻,介紹給大家這個商業的世界。

FB粉專會頻繁地更新 Larry 對於商業、社會、人生的觀察與心得,歡迎大家追蹤互動~