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
f5482a33
Commit
f5482a33
authored
Aug 24, 2018
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document custom DispatcherServlet requirement
Closes gh-14145
parent
9e5395f0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
6 deletions
+16
-6
howto.adoc
...oot-project/spring-boot-docs/src/main/asciidoc/howto.adoc
+16
-6
No files found.
spring-boot-project/spring-boot-docs/src/main/asciidoc/howto.adoc
View file @
f5482a33
...
@@ -1308,12 +1308,22 @@ source for more details.
...
@@ -1308,12 +1308,22 @@ source for more details.
[[howto-switch-off-the-spring-mvc-dispatcherservlet]]
[[howto-switch-off-the-spring-mvc-dispatcherservlet]]
=== Switch Off the Spring MVC DispatcherServlet
=== Switch Off the Spring MVC DispatcherServlet
Spring Boot wants to serve all content from the root of your application (`/`) down. If
By default, All content is served from the root of your application (`/`) down. If you
you would rather map your own servlet to that URL, you can do it. However, you may lose
would rather map to a different path, you can configure one as follows:
some of the other Boot MVC features. To add your own servlet and map it to the root
resource, declare a `@Bean` of type `Servlet` and give it the special bean name,
[source,properties,indent=0,subs="verbatim"]
`dispatcherServlet`. (You can also create a bean of a different type with that name if
----
you want to switch it off and not replace it.)
server.servlet.path=/acme
----
If you have additional servlets you can declare a `@Bean` of type `Servlet` or
`ServletRegistrationBean` for each and Spring Boot will register them transparently to the
container. Because servlets are registered that way, they can be mapped to a sub-context
of the `DispatcherServlet` without invoking it.
Configuring the `DispatcherServlet` yourself is unusual but if you really need to do it, a
`@Bean` of type `DispatcherServletPath` must be provided as well to provide the path of
your custom `DispatcherServlet`.
...
...
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