Google App Engine + Spring 3 MVC REST example. In this tutorial, we will show you how to develop and deploy a Spring 3. MVC REST web application in Google App Engine (GAE) environment. Tools and technologies used : Google App Engine Java SDK 1. Spring 3. 1. 1. JDK 1. Eclipse 3. 7 + Google Plugin for Eclipse. New Web Application Project. Gradle 로컬 캐시로 인한 빌드 실패. 얼마 전 회사에서 Java 버전을 Java 7 버전으로 업그레이드 했다. 이에 따라 JDK, Tomcat 7을 구성하고 언어 스팩을 @1.7 버전으로 설정한 후. This tutorial shows how to create a Java application and deploy it to Azure App Service API Apps using Git. The instructions in this tutorial can be followed on any operating system that is capable of running Java. For us Java developers, Docker helps isolate our apps in a clean environment, so the unpredictability of “works on my machine” is a little less irritating. DeveloperWorks; Technical topics; Java technology; Technical library; Build a portable Java EE app across Bluemix and private cloud patterns. Preserving the “write once, run anywhere” promise of Java between cloud. ![]() ![]() ![]() In this tutorial, we will show you how to develop and deploy a JSF 2.0 web application in Google App Engine (GAE) environment. Tools and technologies used : JDK 1.6; Eclipse 3.7 + Google Plugin for Eclipse; Google App Engine. In Eclipse, create a new Web Application project, named as “Spring. MVCGoogle. App. Engine“. The “Google Plugin for Eclipse” will generate a sample of GAE project structure. Spring 3. 0 Dependencies. To use Spring MVC + REST in GAE, you need following jarsaopalliance- 1. RELEASE. jarspring- asm- 3. RELEASE. jarspring- beans- 3. RELEASE. jarspring- context- 3. RELEASE. jarspring- context- support- 3. RELEASE. jarspring- core- 3. RELEASE. jarspring- expression- 3. RELEASE. jarspring- web- 3. RELEASE. jarspring- webmvc- 3. RELEASE. jar. Copy and put it in “war/WEB- INF/lib” folder. Add it to your project’s build path as well – right click on project folder, select “Properties“. Select “Java Build Path” - > “Libraries” tab, click “Add Jars” button and select above jars. Spring Controller. Delete auto generated Spring. MVCGoogle. App. Engine. Servlet. java, you don’t need this. Create a bean, act as controller in REST structure. In addition, DI a message into the “message” property. File : src/com/mkyong/Movie. Controller. java. Controller. import org. Model. Map. import org. Path. Variable. import org. Request. Mapping. Request. Method. @Request. Mapping("/movie"). Movie. Controller {. DI via Spring. String message. Request. Mapping(value="/{name}", method = Request. Method. GET). public String get. Movie(@Path. Variable String name, Model. Map model) {. model. Attribute("movie", name). Attribute("message", this. Message(String message) {. JSP Pages. Create a list. File : war/list. jsp. GAE + Spring 3 MVC REST example< /h. Movie : ${movie} , DI message : ${message}< /h. Spring Configuration. Create a Spring XML bean configuration file, define the beans and view resolver. File : war/WEB- INF/mvc- dispatcher- servlet. XMLSchema- instance". Location=". http: //www. Need DI a message into controller, so auto component scan is disabled. Controller bean. Only controller need this hack. Movie.*" />. < /context: component- scan>. Bean to show you Di in GAE, via Spring, also init the Movie. Controller - ->. Movie. Controller">. Hello World< /value>. Internal. Resource. View. Resolver">. Update web. xml, integrate Spring framework. File : war/WEB- INF/web. XMLSchema- instance". Location="http: //java. Dispatcher. Servlet. Config. Location< /param- name>. WEB- INF/mvc- dispatcher- servlet. Context. Loader. Listener. Directory Structure. Review the final directory structure. Run on Local. Right click on the project, run as “Web Application“. URL : http: //localhost: 8. Avengers. 9. Deploy on GAEUpdate appengine- web. App Engine application ID. File : war/WEB- INF/appengine- web. WEB- INF/logging. Select project, click on Google icon, “Deploy to App Engine“. URL : http: //mkyong- springmvc. Download Source Code. Due to large file size, all Spring and GAE jars are excluded. References. Spring 3. REST explains Wikipedia. Google App Engine + Java + Google Plugin for eclipse example. Spring 3 MVC hello world example. Spring 3 REST hello world example. Google Add Engine Java doc.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
October 2016
Categories |