Install Google Apps Engine development environment
1. Install eclipse
2. Go to http://code.google.com/eclipse/docs/getting_started.html to check update site URL according to your version of Eclipse.
3. Run eclipse, select menu help > install new software > Add new site by using above google plugin site URL
4. Select all checkboxes, and then follow the wizard to install google plugin.
5. restart eclipse
Create first Google App
1. In eclipse, Select the File menu > New > Web Application Project
2.
The "Create a Web Application Project" wizard opens. For "Project name " enter " Guestbook
", For "Package" enter " guestbook
". If you're not using Google Web Toolkit, uncheck "Use Google Web Toolkit" Verify that "Use Google App Engine" is checked
3. Click Finish
The wizard creates a directory structure for the project like this
Guestbook/
src/
guestbook/
server/
GuestbookServlet.java
META-INF/
jdoconfig.xml
log4j.properties
logging.properties
war/
WEB-INF/
lib/
...App Engine JARs...
appengine-web.xml
web.xml
index.html
Run the project in local simulated environment web server
1. select menu Run > Debug/Run As > Web Application
2. If the server starts successfully, the server displays several messages, including a message similar to the following, in the Console
The server is running at http://localhost:8888/
3. open a web browser, try to access http://localhost:8888/guestbook
4. To stop the server, switch to “Debug” perspective, in Debug panel, click Stop button
Note : 如果你修改 java files, jsp, static files and appengine-web.xml ,则不需要 restart server 。但如果你修改了 web.xml ,则需要 restart server.
Upload app to Google Apps Engine
1. Go to https://appengine.google.com , and use your gmail account and pwd to login
2. Click “Create an Application ” button (one gmail account can create 10 apps)
3. Input “Application Identifier ” (e.g. “tomsonguestbook ”), and “Application Title ” (e.g. “Guest Book ”). If you are creating your first app, you need to input your mobile number (e.g. +852 6309XXXX), and a code is sent to you by SMS.
4. Click “Create Application ” button
5. Back to Eclipse, edit the appengine-web.xml file of your project, and change the <application>...</application> element to contain the “Application Title ” value in Step 3.
6. In eclipse tool bar, click the button “Deploy App Engine Project ” (the icon is a plane )
7. In the popup window, input your administrator account username (your email address) and password, click “Deploy ” button.
8. Test your application on App Engine by visiting its URL:
http://<your application ID>.appspot.com/guestbook