Friday, January 18, 2013

Running Spring 3.2 on Google App Engine

We will walk through the minimum to set up Spring MVC on Google App Engine.

Below are the specs that we are using:
  • Java 1.6
  • Spring MVC 3.2
  • Google App Engine SDK 1.7
  • Spring Tool Suite 3.1

Launch Spring Tool Suite.

In the Dashboard (one of the tabs), click Extensions. Find and install Google Plugin.

Create a Google App Engine Project. Do not check GWT.

First put the following Spring dependencies to /war/WEB-INF/lib
  • spring-aop-3.2.0.RELEASE.jar
  • spring-beans-3.2.0.RELEASE.jar
  • spring-context-3.2.0.RELEASE.jar
  • spring-context-support-3.2.0.RELEASE.jar
  • spring-core-3.2.0.RELEASE.jar
  • spring-expression-3.2.0.RELEASE.jar
  • spring-web-3.2.0.RELEASE.jar
  • spring-webmvc-3.2.0.RELEASE.jar

You will also need:
Right click on the root folder of the project. Click Properties. Click Java Build Path. Add all the jars above.

In /war/WEB-INF/web.xml, add the following:



Create /war/WEB-INF/spring-mvc-servlet.xml.

Replace with:


Create the folder /war/views.

Create the file /war/views/hello_world.jsp.

Create the file /src/com.yournamespace.controller.HelloWorldController.java

Put the following:


The above returns the hello_world.jsp.

Right click on the root project folder. Click Run as -> Web Application.

No comments:

Post a Comment