Categories
Computing Java Web Development

Google App Engine: Brief First Impression

Started playing with the Google Apps Engine last night. Now that Java is supported, even I can be lured after the magical charm of what is close to the infinite scalability holy grail. These are my impressions spending a couple of hours with the tutorial:
1. Eclipse makes it easy
Google created a pretty nifty plugin for the latest generation of Eclipse to help you with app engine development. It generates some of the code you need and hides the boring stuff. It also contains a Jetty app server that helps you deploy apps locally for debugging.

2. Old Java, new tricks?
Google appears to want to simplify the uptake and adoption. Therefore the tutorial uses old school servlets and JSPs. Need to test deeper to see if there is any reason not to use more modern Sping framework and templating engines like Velocity. Doubt that.

3. It’s JDO, JPA: not your average ORM
This will take some getting used to. To gain access to the bounty of ‘infinite’ no headache (supposedly) storage you will need to get cozy with JDO or JPA. These mainstream Java standards are less popular than Hibernate and other ORM libraries. You will need to learn yet another framework. Had one nit here with an annotation specifying the type of primary key causing a bug.

Overall, though, things appeared polished and working. Cannot wait to play more.

Share
Categories
General

Jetty 6 welcome file: how to use a servlet to handle your welcome file

I ‘ported’ my Java web application from Tomcat to Jetty. Like any web application, I defined a ‘welcome file’ in the application’s web.xml file. The welcome-file directive specifies the URL to be loaded by default when someone requests the root of your application. The welcome file may be just a file or a JSP, e.g. index.html, or it may be a name that is mapped to a servlet’s url (through the element in web.xml).

In Tomcat, specifying something like

Code listing of web.xml file

will work just as you would expect. But in Jetty, it will not. Unless you provide a workaround. What the somewhat angrily written post says is this: If you map a servlet to the URL index.htm, a file called index.htm must still exist. You *must* have a static, even empty, file called index.htm to have Jetty pass the request to your servlet that is mapped to that URL. Sorta cludgy, glad I found the answer quickly. Hope this helps others.

Share
Share