In this tutorial we will learn how to configure Spring Boot embedded server to accept HTTPS request for your Web applications. by creating a self signed certificate.
With earlier versions of Spring Boot, it was cumbersome to import additional properties or yaml files short of using application.properties and application.yml. You could use the spring.config.additional-location property, but you needed to set it pretty early and it was quite limited with the types of files that it could deal with.
Log4j2 is the latest release of the popular Logging Framework. In this tutorial we will learn how to integrate Log4j2 configuration file in an example Spring Boot web application.
You can configure an Access Control List for IP Addresses in Spring Boot through the IPAddressAccessControlHandler. Let’ see how to do it.
You can configure Undertow Pool size in Spring Boot applications through UndertowServletWebServerFactory. Let’s learn how to do it.
This tutorial shows how to trace incoming HTTP requests using CommonsRequestLoggingFilter.
Spring Boot applications support YAML as an alternative to the application.properties file. YAML isn’t a markup language but it allows you to define properties in the hierarchical configuration.
The Spring Framework provides a straightforward abstraction for sending email by using the
JavaMailSender interface, and Spring Boot provides auto-configuration for it as well as a starter module. Start by creating a new project which uses the “mail” starter module:
You can configure HTTP Session Timeout for Spring Boot Applications in two ways:
Configuring Session Timeout in application.properties
The simplest option is to include in your application.properties the parameter server.servlet.session.timeout. For example:
Also note that Tomcat will not allow you to set the timeout any less than 60 seconds.
Configuring Session Timeout Programmatically
Let’s say we want that our HttpSession last only two minutes. To make this happen, we can add to our WebConfiguration class an EmbeddedServletContainerCustomizer Bean with the following content:
Spring Boot automatically starts an application in web server mode if it finds the web starter module in the classpath. To disable web server configuration, set the webApplicationType to none in the application.properties file as in this example: spring.main.web-application-type=none Copy