Advanced Computing Intro For App Engine
Advanced Computing Intro For App Engine
Advanced Computing Intro For App Engine
Implement simple Java Web application and deploy on the Google appspot. Tools used : 1. JDK 7 2. Eclipse 3.7 (Indigo)+ Google Plugin for Eclipse 3. Google App Engine Java SDK
What is Eclipse?
In computer programming, Eclipse is comprising a a multi-language Integrated an development for
environment (IDE)
customizing the environment. It is written mostly in Java. It can be used to develop applications in Java and, by means of various plug-ins, other programming
languages including Ada, C, C++, COBOL, Fortran, Haskell, JavaScript,Perl, PHP, Python, R, R uby (including Ruby on Rails framework), Scala, Clojure, Groovy, Scheme, and Erlang. It can also be used to develop packages for the software Mathematica. Development environments include the Eclipse Java development tools (JDT) for Java and Scala, Eclipse CDT for C/C++ and Eclipse PDT for PHP, among others.
What is IDE?
An integrated development environment (IDE) or interactive development environment is a software application that provides comprehensive facilities to computer programmers for software development. An IDE normally consists of asource code editor, build automation tools and a debugger. Several modern IDEs integrate with Intelli-sense coding features. Some IDEs contain a compiler, interpreter, or both, such as Net Beans and Eclipse; others do not, such as SharpDevelopand Lazarus. The boundary between an integrated development environment and other parts of the broader software development environment is not welldefined. Sometimes a version control system and various tools are integrated to simplify the construction of a GUI. Many modern IDEs also have a class browser, an object browser, and a class hierarchydiagram, for use with object-oriented software development.
Using the Google Plugin for Eclipse It's easy to use the Eclipse development environment to develop your Java App Engine application, just as you can to develop any other servlet-based web application. With the Google Plugin for Eclipse, it's even easier. The plugin lets you create, test and upload App Engine applications from within Eclipse. The Google Plugin for Eclipse also makes it easy to develop applications using Google Web Toolkit (GWT), to run on App Engine or in any other environment. 1. 2. 3. 4. 5. Getting Eclipse Installing the Google Plugin for Eclipse Creating a Project Running the Project Deploying the Project
Getting Eclipse The Google Plugin for Eclipse is available for Eclipse 3.3 (Europa), Eclipse 3.4 (Ganymede), Eclipse 3.5 (Galileo), Eclipse 3.6 (Helios), Eclipse 3.7 (Indigo), and Eclipse 4.2 (Juno). The "Eclipse IDE for Java EE Developers" includes all of the components you will need for web application development. In addition to the Google Plugin for Eclipse, we recommend the Web Tools Platform (WTP) plugins for web development. See the Web Tools Platform website. Among other things, WTP provides editing modes for JSP and HTML files.
Installing the Google Plugin for Eclipse To install the plugin, using Eclipse 3.7 (Indigo): 1. Select the Help menu > Install New Software.... 2. In the Work with text box, enter: https://dl.google.com/eclipse/plugin/3.7
Click the Add... button. In the dialog that shows, click OK (keep the name blank, it will be retrieved from the update site.) 3. Click the plus icon next to "Google Plugin for Eclipse" and "SDKs". Check the boxes next to "Google Plugin for Eclipse 3.7" and "Google App Engine Java SDK". You can also select the "Google Web Toolkit SDK" if you'd like to use Google Web Toolkit with your apps. Make sure you check the checkbox labeled "Contact all update sites during install to find required software." Click the Next button. Follow the prompts to accept the terms of service and install the plugin. 4. When the installation is complete, Eclipse prompts you to restart. Click Yes. Eclipse restarts. The plugin is installed.
Creating a Project
To create a new App Engine project:
1. Select the File menu > New > Web Application Project (If you do not see this menu option, select the Window menu > Reset Perspective..., click OK, then try the File menu again.) Alternatively, click the Google button in the Eclipse toolbar and select "New Web Application Project."
2. The "Create a Web Application Project" wizard opens. For "Project name," enter a name for your project, such as Helloworld for the project. For "Package," enter an appropriate package name, such as com.mykong. 3. If you're not using Google Web Toolkit, uncheck "Use Google Web Toolkit." Verify that "Use Google App Engine" is checked. 4. If you installed the App Engine SDK using Software Update, the plugin is already configured to use the SDKs that were installed. If you would like to use a separate installation of the App Engine SDK, click Configure SDKs..., and follow the prompts to add a configuration with your SDK's appengine-java-sdk/ directory. 5. Click Finish to create the project.
Hello World
Review the generated project directory.
...other configuration... war/ ...JSPs, images, data files... WEB-INF/ ...app configuration... lib/ ...JARs for libraries... classes/ ...compiled classes...
The extra is this file appengine-web.xml , Google App Engine need this to run and deploy the application. File : appengine-web.xml
<?xml version="1.0" encoding="utf-8"?> <appengine-web-app xmlns="http://appengine.google.com/ns/1.0"> <application></application> <version>1</version>
</appengine-web-app>
Run it local
Right click on the project and run as Web Application. Eclipse console :
//... INFO: The server is running at http://localhost:8888/ 30 Mac 2012 11:13:01 PM com.google.appengine.tools.development.DevAppServerImpl start INFO: The admin console is running at http://localhost:8888/_ah/admin
In this demonstration, I created an application ID, named mkyong123, and put it in appengine-web.xml . File : appengine-web.xml
<?xml version="1.0" encoding="utf-8"?> <appengine-web-app xmlns="http://appengine.google.com/ns/1.0"> <application>mkyong123</application> <version>1</version>
</appengine-web-app>
To deploy, see following steps: Figure 1.1 Click on GAE deploy button on the toolbar.
Figure 1.2 Sign in with your Google account and click on the Deploy button.
Figure 1.3 If everything is fine, the hello world web application will be deployed to this URL http://mkyong123.appspot.com/