简体   繁体   中英

Google App Engine with Spring MVC

I want to use GAE with Spring MVC

so, I found this following site.

here

but This site's example seems to manually add jar files.

I think it is inefficient.

In eclipse, Is there another way like adding dependency on pom.xml in spring MVC project?

I would suggest you to git clone the guestbook-spring project (it's adding Spring MVC to the GAE guestbook example) and continue from there.

We have builded our webapp app based on this, and it's great.

PS Also, it got tests for the controller included. It's good to have it as inspiration for testing you future app (as a developing practice).

You could use gae archetype to create your project firstly, and then add spring components to pom.xml:

mvn archetype:generate -Dappengine-version=1.9.14 -Dapplication-id=your-app-id -Dfilter=com.google.appengine.archetypes

where -Dappengine-version is set to the most recent App Engine Java SDK version, and application-id is set to the Developer console application ID used for your app.

Yes, if you have created a maven project, then it is much easier to add dependencies using pom.xml.

You can edit directly, or use eclipse maven pom manager to add dependencies directly, or from a repository.

The link you gave does not create a maven project, but you can modify the instructions so it does.

You can create maven project instead of Web Application at the start, then add Spring dependencies and continue adding dependencies from there.

You can also follow this video tutorial . It will give you step by step idea how to deploy your app in the Google App Engine.

I found simple way.

1.First, Create Spring MVC Project, and add dependency and plugin in pom.xml

1.1 add gae dependency

 <dependency>
        <groupId>com.google.appengine</groupId>
        <artifactId>appengine-api-1.0-sdk</artifactId>
        <version>1.9.14</version>
 </dependency>

1.2 add gae plugin

  <plugin>
        <groupId>com.google.appengine</groupId>
        <artifactId>appengine-maven-plugin</artifactId>
        <version>1.9.14</version>
  </plugin>
  1. In WEB-INF, create appengine-web.xml and logging.properties

then, you can run it on server

在右键单击项目 - >配置 - >转换为maven项目之后,创建一个新的Web应用程序项目。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM