1. 先修改 N:\PlayFramework\play-1.1\members\war\WEB-INF\appengine-web.xml
將GAE設定的Application ID 和版本號填入
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0"> <application>arthur201104</application> <version>1</version> </appengine-web-app>
再將專案匯出成WAR目錄架構
N:\PlayFramework\play-1.1>play war members -o members.war ~ _ _ ~ _ __ | | __ _ _ _| | ~ | '_ \| |/ _' | || |_| ~ | __/|_|\____|\__ (_) ~ |_| |__/ ~ ~ play! 1.1, http://www.playframework.org ~ 00:44:41,359 INFO ~ Starting N:\PlayFramework\play-1.1\members 00:44:41,390 INFO ~ Module siena is available (N:\PlayFramework\play-1.1\module s\siena-1.5) 00:44:41,390 INFO ~ Module gae is available (N:\PlayFramework\play-1.1\modules\ gae-1.4) 00:44:42,187 WARN ~ 00:44:42,187 WARN ~ Google App Engine module 00:44:42,187 WARN ~ ~~~~~~~~~~~~~~~~~~~~~~~ 00:44:42,203 WARN ~ No Google App Engine environment found. Setting up a develo pment environement 00:44:42,218 WARN ~ Don't forget to define your GAE application id in the 'war/ WEB-INF/appengine-web.xml' file 00:44:42,218 WARN ~ 00:44:42,218 INFO ~ Precompiling ... 00:44:48,218 INFO ~ Done. ~ Packaging current version of the framework and the application to N:\PlayFrame work\play-1.1\members.war ... ~ Done ! ~ ~ You can now load N:\PlayFramework\play-1.1\members.war as a standard WAR into your servlet container ~ You can't use play standard commands to run/stop/debug the WAR application... ~ ... just use your servlet container commands instead ~ ~ Have fun! ~
最後上傳至GAE,第一次上傳過程中需要輸入Google的帳號和密碼...
M:\appengine-java-sdk-1.4.3\bin>appcfg update N:\PlayFramework\play-1.1\members. war Reading application configuration data... 2011/7/6 上午 12:59:14 com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml 資訊: Successfully processed N:/PlayFramework/play-1.1/members.war\WEB-INF/appen gine-web.xml 2011/7/6 上午 12:59:14 com.google.apphosting.utils.config.AbstractConfigXmlReade r readConfigXml 資訊: Successfully processed N:/PlayFramework/play-1.1/members.war\WEB-INF/web.x ml 2011/7/6 上午 12:59:14 com.google.apphosting.utils.config.IndexesXmlReader readC onfigXml 資訊: Successfully processed N:\PlayFramework\play-1.1\members.war\WEB-INF\appen gine-generated\datastore-indexes-auto.xml Beginning server interaction for arthur201104... 0% Creating staging directory 5% Scanning for jsp files. 20% Scanning files on local disk. 25% Scanned 250 files. 28% Initiating update. 31% Cloning 252 application files. 33% Cloned 100 files. 34% Cloned 200 files. 40% Uploading 70 files. 52% Uploaded 17 files. 61% Uploaded 34 files. 68% Uploaded 51 files. 73% Uploaded 68 files. 77% Initializing precompilation... 90% Deploying new version. 95% Will check again in 1 seconds. 98% Will check again in 2 seconds. 99% Will check again in 4 seconds. 99% Closing update: new version is ready to start serving. 99% Uploading index definitions. Update completed successfully. Success. Cleaning up temporary files... M:\appengine-java-sdk-1.4.3\bin>
完成之後連到你在GAE設定的Application網址,就可以看見成果了~
http://arthur201104.appspot.com/basicmemberoperation/index
http://arthur201104.appspot.com/enhancememberoperation/index