JSP/Servlet | Creating a GAE Application | Deploying a Web Application
Now let’s deploy the project you created to the GAE server. We have not made anything yet, but because sample files are included, it will work even if we deploy it as is.
First, configure the settings needed to deploy the project to the application installed in GAE. Double-click “appengine-web.xml” in “WEB-INF” to open it. The file opens in an XML editor, a dedicated editor for editing XML data. This XML editor lets you edit the contents of the XML tag list.
In the tag list, item names are displayed on the left and their values are displayed on the right. If you double-click the value area on the right, you can edit the value. After making changes, save them with [Save] from the [File] menu. You can also save with the Ctrl+S shortcut.
When you open this file, you should see the following item. Configure it.
- application: This specifies the name of the GAE application to deploy to. Enter the “project ID” that you created earlier on the GAE site.
If the XML editor does not work well, click and select the “Source” tab from the “Design” and “Source” tabs below the editor area. You can edit the XML source code directly in a text editor. Modify the following part near the beginning.
<? xml version = "1.0"encoding = "utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application> ... write the project ID here ... </application>
<version>1</version>
...... omitted below ......
Write the “project ID” between the <application> ~ </application> tags.
Running the deployment
After modifying the XML file, deploy the project. Follow these steps.
-
In Package Explorer, click and select the project folder, the “MyGaeApp” folder.
-
Click the fourth icon from the left on the toolbar under the menu, the one with Google’s “g” inside a blue circle. A menu appears. Select [Deploy to App Engine …] from it.
-
The Google account sign-in screen appears, if you have not yet signed in from Eclipse. Enter the email address and password registered for your GAE account, and click “Sign in”.
-
A message appears saying that “Google Plugin for Eclipse is requesting the following permissions”. Press the “Allow” button.
- This part from steps 1 through 4 is not displayed after you are signed in to Google from Eclipse.
-
A dialog named “Delpoy” appears. Specify the project to deploy here. In this case, it is “MyGaeApp”, so press the “Deploy” button as is. If the project is not set, press the “Browse …” button on the right and select the project.
-
When deployment starts, a dialog appears and shows the progress with a progress bar. When the dialog disappears and deployment finishes successfully, a web page opens.
After deployment, access the GAE site at https://console.cloud.google.com/appengine/. Select the relevant project at the top and choose [Dashboard]. The version is displayed as “1”, and the URL, for example project-id.appspot.com, is displayed on the right side. Click this URL to access the web application. If a page saying “Hello App Engine!” appears, deployment succeeded.
If you look at the deployed address, you can see that it has the following format.
http://project-id.appspot.com
All GAE applications are assigned addresses in this way. Of course, they are published like ordinary websites and anyone can access them. Since it is still only a sample, publishing it does not mean much yet, but if you continue studying and turn it into your own web application, many people may use it once it is public.