Using groovy to write Google App engine apps

Source: Internet
Author: User

Google's Google App Engine cloud computing platform now supports languages other than Python: Java and groovy!

Now, you can use groovy to efficiently write your Google app Engine apps.

A few weeks ago, the SpringSource groovy team worked closely with the Google App Engine Java team to deal with a number of detail issues, To ensure that this award-winning, popular JVM based dynamic language--groovy can run well on this wonderful platform. They have written some patches for groovy on those areas that are restrictive and have strong security management policies, and then released the Groovy 1.6.1 update on the scheduled date. In the new version, you can start writing your app through groovy and run it on Google's kernel by deploying "Groovy-all" JAR files directly in your Web-inf/lib directory.

In the rest of the text, I'll take you through some simple steps to create your first groovy-based app Engine Web application. As they are clearly listed in the app Engine document, I will skip the basic installation steps here, and I will focus on all aspects of building the Groovy application itself. As you're about to see, it's going to be pretty easy.

Getting Started

First of all, obviously you have to register a Google account on Google App Engine so that you can create apps on the platform and upload them to the cloud. You will also need to download and install the Google App Engine Java SDK. For all of the above steps, you should refer to the online documentation, where you can find all the details you need.

Once the SDK is installed, you should also download and install Groovy1.6 for this course. The previous steps in this article require us to compile a servlet with groovy, and you'll use groovy, but in the rest of it, because we're going to use groovy at runtime to compile the groovlets, you're not going to need it anymore.

With Java, SDK, Groovy setup, we can go ahead and build a new project through the Groovy-ready project template. Download the summary, extract to a directory you like, below let's see what's inside! It feels like unpacking the Christmas gift, right?

I unzipped this template project to a directory called Gaedemo. At the root of this directory, you will see a src directory containing all of our Groovy and Java source code needs to be compiled (servlets, domain classes, utility classes, and so on). The Deploy directory is basically consistent with the webapp we're going to output: you'll see a classes directory containing all the compiled classes, with a variety of JAR file lib directories (Groovy jar and Google App Engine own API jar one sample), as well as the groovy catalog for storing groovlet. In the second part of this article, we will develop these groovlets. You will of course notice the Appengine-web.xml file, which is an APP Engine special descriptor. You can find the standard web.xml, in which you can define your own servlets, your mapping relationship, and other things.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.