Importing properties from an external file in Spring Boot

With earlier versions of Spring Boot, it was cumbersome to import additional properties or yaml files short of using 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.

Read more

Configuring HTTP Session timeout in Spring Boot applications

You can configure HTTP Session Timeout for Spring Boot Applications in two ways:

Configuring Session Timeout in

The simplest option is to include in your 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:

Read more

How to disable web server configuration in Spring Boot ?

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 file as in this example: spring.main.web-application-type=none Copy