One of the common things on web application development is to initialize or invoke a piece of code at the start up of the application. If you are developing a traditional Java web application, the startup logic can be mentioned in the ServletContextListener. Spring also offers very convenient way of invoking the events at the …
@EnableAutoConfiguration Annotation in Spring Boot
@EnableAutoConfiguration annotation auto-configures the beans that are present in the classpath. This simplifies the developers work by guessing the required beans from the classpath and configure it to run the application. This annotation is part of the spring boot project. For example, if you have tomcat-embedded.jar in the classpath, then you will need a TomcatEmbeddedServletContainerFactory …
@EnableCaching Annotation in Spring
@EnableCaching annotation is the annotation-driven cache management feature in the spring framework. This annotation has been added to the spring since the version 3.1. If you are using this annotation, then you are not required to write the XML bean definitions for cache manager. When you annotate your configuration class with @EnableCaching annotation, this triggers …
@SpringBootApplication Annotation in Spring Boot
@SpringBootApplication annotation is a convenience annotation introduced from Spring Boot 1.2.0. If you have worked on the earlier spring boot versions, it is common that main class always annotate with the following annotations: @Configuration : This annotation is not specific to the spring boot applications. This annotation tags the class as the source for bean definitions. …
Ultimate Guide for Spring Boot DevTools
The main reason why Spring Boot is developed by Spring community is to simplify the packaging and deploying your spring applications to production. Keeping with that in mind, spring boot assumes all the default values loaded at startup is optimized for the production ready application. For example, caching of Thymeleaf templates are enabled by default which improves the performance in …
Caching Support in Spring Boot
This tutorial highlights the new features added as part of the spring boot 1.3.0 for caching support. Caching has been supported by spring boot, but there is no auto configuration option for the caching in spring boot until now. The new Spring Boot release 1.3.0 has introduced the following features that makes easier to use the caching within spring …
Array Vs ArrayList in Java
What is the difference between Array and ArrayList is the quite common question for the Java interview and for the beginners who are learning Java programming. I have started writing the Java best practices series, this is one of the post for clearing the air on misconception about popular Java classes Array and ArrayList. 1. Flexible …
How To Add Environment Entries (JNDI) to Tomcat Web Server
Have you tried configuring the JNDI variables with Tomcat server?. This tutorial is going to explain you step-by-step procedure on how to configure JNDI variables in your tomcat server. It is very simple configuration in the Tomcat server’s configuration XML file. Open the Tomcat server’s context.xml file. The same change can be done using the …