Spring Boot Reference Guide
72.8. Discover built-in options for external properties.......................................................236
73. Embedded servlet containers..............................................................................................237
73.1. Add a Servlet, Filter or Listener to an application.....................................................237
Add a Servlet, Filter or Listener using a Spring bean...............................................237
Disable registration of a Servlet or Filter..........................................................237
Add Servlets, Filters, and Listeners using classpath scanning.................................237
73.2. Change the HTTP port.............................................................................................238
73.3. Use a random unassigned HTTP port......................................................................238
73.4. Discover the HTTP port at runtime...........................................................................238
73.5. Configure SSL.......................................................................................................... 238
73.6. Configure Access Logging....................................................................................... 239
73.7. Use behind a front-end proxy server........................................................................239
Customize Tomcat’s proxy configuration..................................................................240
73.8. Configure Tomcat..................................................................................................... 240
73.9. Enable Multiple Connectors with Tomcat.................................................................240
73.10. Use Tomcat’s LegacyCookieProcessor.................................................................241
73.11. Use Jetty instead of Tomcat...................................................................................241
73.12. Configure Jetty....................................................................................................... 242
73.13. Use Undertow instead of Tomcat...........................................................................242
73.14. Configure Undertow............................................................................................... 243
73.15. Enable Multiple Listeners with Undertow...............................................................243
73.16. Use Tomcat 7.x or 8.0............................................................................................ 243
Use Tomcat 7.x or 8.0 with Maven...........................................................................243
Use Tomcat 7.x or 8.0 with Gradle...........................................................................244
73.17. Use Jetty 9.2.......................................................................................................... 244
Use Jetty 9.2 with Maven......................................................................................... 244
Use Jetty 9.2 with Gradle......................................................................................... 244
73.18. Use Jetty 8.............................................................................................................244
Use Jetty 8 with Maven.............................................................................................245
Use Jetty 8 with Gradle.............................................................................................245
73.19. Create WebSocket endpoints using @ServerEndpoint.........................................245
73.20. Enable HTTP response compression....................................................................246
74. Spring MVC......................................................................................................................... 247
74.1. Write a JSON REST service....................................................................................247
74.2. Write an XML REST service....................................................................................247
74.3. Customize the Jackson ObjectMapper....................................................................247
74.4. Customize the @ResponseBody rendering.............................................................249
74.5. Handling Multipart File Uploads...............................................................................249
74.6. Switch off the Spring MVC DispatcherServlet..........................................................249
74.7. Switch off the Default MVC configuration.................................................................250
74.8. Customize ViewResolvers.......................................................................................250
74.9. Use Thymeleaf 3...................................................................................................... 251
75. HTTP clients........................................................................................................................ 252
75.1. Configure RestTemplate to use a proxy...................................................................252
76. Logging................................................................................................................................ 253
76.1. Configure Logback for logging.................................................................................253
Configure logback for file only output.......................................................................254
76.2. Configure Log4j for logging......................................................................................254
Use YAML or JSON to configure Log4j 2.................................................................255
77. Data Access......................................................................................................................... 256
1.5.2.RELEASE Spring Boot xi