Can i use Spring on GAE?

前端 未结 2 1141
Happy的楠姐
Happy的楠姐 2021-02-14 01:10

Can i use Spring Webflow/MVC and Spring Security and Hibernate on Google App Engine?

Is there a list/summary of java frameworks that can be used on the GAE?

2条回答
  •  攒了一身酷
    2021-02-14 01:31

    Will it Play In Java lists frameworks, languages and libraries that work (or not) in Google App Engine. At present, the information listed is:

    Spring MVC

    Version     2.5.6
    Status  COMPATIBLE
    

    To see Spring's MVC framework running on App Engine, check out the autoshoppe sample application. If you're using Spring forms (e.g. using the spring-form.tld tag library and subclassing SimpleFormController), you will need to register custom editors for your properties. This is covered in http://groups.google.com/group/google-appengine-java/browse_thread/thread/d93fd7385bf85bf7.

    Spring ORM

    Version     2.5.6
    Status  COMPATIBLE
    

    To get Spring working with the App Engine-provided JPA interface, follow the instructions at http://objectuser.wordpress.com/2009/05/19/spring-jpa-in-google-app-engine/, which discusses a workaround to the dependency on javax.naming needed for @PersistenceContext. A more complex workaround is available at http://groups.google.com/group/google-appengine-java/browse_thread/thread/187d41712ec1d394.

    Spring Security

    Version(s)  ?
    Status  SEMI-COMPATIBLE
    

    To work around a ClassNotFoundException, you can use a re-compiled version of the library which adds a StringInsensitiveComparator class -- the download is provided at http://www.google-app-engine.com/blog/post/Spring-security-fix-for-google-app-engine.aspx. See http://www.dotnetguru2.org/bmarchesson/index.php?p=1100 for tips on how to get Spring Security running with App Engine and GWT (in French). See http://groups.google.com/group/google-appengine-java/browse_thread/thread/964e7f5e42840d9c for discussion on the integration.

    Hibernate

    Versions     All
    Status  INCOMPATIBLE
    

    You cannot currently use Hibernate directly. The differences between the App Engine datastore and SQL were too great to get the standard Hibernate up and running under App Engine. App Engine does support JDO and JPA, so you may be able to convert your Hibernate code to use one of these ORM interfaces.

    I suppose that it should work with Spring 3.0 too, I will try soon and share the results.

    UPDATE: I tried a Spring MVC Hello World with Spring 3.0.6 with Google App Engine and it worked perfectly, both locally and in the cloud. The drawback though, is longer load time when a new instance starts.

提交回复
热议问题