diff --git a/spring-boot-docs/src/main/asciidoc/cloud-deployment.adoc b/spring-boot-docs/src/main/asciidoc/cloud-deployment.adoc index 4adc789820..4cfc40b3e0 100644 --- a/spring-boot-docs/src/main/asciidoc/cloud-deployment.adoc +++ b/spring-boot-docs/src/main/asciidoc/cloud-deployment.adoc @@ -299,6 +299,10 @@ run the app. A http://issues.gradle.org/browse/GRADLE-2871[bug in Gradle] curren prevents you from using Gradle newer than 1.6. +[[cloud-deployment-gae]] +== Google App Engine +Google App Engine is tied to the Servlet 2.5 API, so you can't deploy a Spring Application +there without some modifications. See the <> of this guide. [[cloud-deployment-whats-next]] == What to read next diff --git a/spring-boot-docs/src/main/asciidoc/howto.adoc b/spring-boot-docs/src/main/asciidoc/howto.adoc index 8f885ca422..d591a147ee 100644 --- a/spring-boot-docs/src/main/asciidoc/howto.adoc +++ b/spring-boot-docs/src/main/asciidoc/howto.adoc @@ -2064,3 +2064,7 @@ context. Applications that are not already Spring applications might be convertible to a Spring Boot application, and the guidance above might help, but your mileage may vary. + +[[howto-servlet-2-5]] +=== Deploying a WAR in an Old (Servlet 2.5) Container +include::servlet-2.5.adoc[] diff --git a/spring-boot-docs/src/main/asciidoc/servlet-2.5.adoc b/spring-boot-docs/src/main/asciidoc/servlet-2.5.adoc new file mode 100644 index 0000000000..dc4fe3bdc2 --- /dev/null +++ b/spring-boot-docs/src/main/asciidoc/servlet-2.5.adoc @@ -0,0 +1,61 @@ +Spring Boot uses Servet 3.0 APIs to initialize the `ServletContext` +(register `Servlets` etc.) so you can't use the same application out +of the box in a Servlet 2.5 container. It *is* however possible to run +a Spring Boot application on an older container with some special +tools. If you include `org.springframework.boot:spring-boot-legacy` as +a dependency +(https://github.com/scratches/spring-boot-legacy[maintained +separately] to the core of Spring Boot and currently available at +1.0.0.RELEASE), all you should need to do is create a `web.xml` and +declare a context listener to create the application context and your +filters and servlets. The context listener is a special purpose one +for Spring Boot, but the rest of it is normal for a Spring application +in Servlet 2.5. Example: + +[source,xml,indent=0] +---- + + + + + contextConfigLocation + demo.Application + + + + org.springframework.boot.legacy.context.web.SpringBootContextLoaderListener + + + + metricFilter + org.springframework.web.filter.DelegatingFilterProxy + r + + + metricFilter + /* + + + + appServlet + org.springframework.web.servlet.DispatcherServlet + + contextAttribute + org.springframework.web.context.WebApplicationContext.ROOT + + 1 + + + + appServlet + / + + + +---- + +In this example we are using a single application context (the one created by the context listener) and +attaching it to the `DispatcherServlet` using an init parameter. This is normal in a Spring Boot +application (you normally only have one application conext).