Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
9b6cb83b
Commit
9b6cb83b
authored
Nov 03, 2014
by
Dave Syer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add documentation for Servlet 2.5 and GAE
Fixes gh-1104
parent
f304d469
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
0 deletions
+69
-0
cloud-deployment.adoc
spring-boot-docs/src/main/asciidoc/cloud-deployment.adoc
+4
-0
howto.adoc
spring-boot-docs/src/main/asciidoc/howto.adoc
+4
-0
servlet-2.5.adoc
spring-boot-docs/src/main/asciidoc/servlet-2.5.adoc
+61
-0
No files found.
spring-boot-docs/src/main/asciidoc/cloud-deployment.adoc
View file @
9b6cb83b
...
...
@@ -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 <<howto.adoc#howto-servlet-2-5, Servlet 2.5 section>> of this guide.
[[cloud-deployment-whats-next]]
== What to read next
...
...
spring-boot-docs/src/main/asciidoc/howto.adoc
View file @
9b6cb83b
...
...
@@ -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[]
spring-boot-docs/src/main/asciidoc/servlet-2.5.adoc
0 → 100644
View file @
9b6cb83b
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]
----
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>demo.Application</param-value>
</context-param>
<listener>
<listener-class>org.springframework.boot.legacy.context.web.SpringBootContextLoaderListener</listener-class>
</listener>
<filter>
<filter-name>metricFilter</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filte>r
<filter-mapping>
<filter-name>metricFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>appServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextAttribute</param-name>
<param-value>org.springframework.web.context.WebApplicationContext.ROOT</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>appServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>
----
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).
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment