@RequestParam and @PathVariable @RequestParam and @PathVariable annotations are used for accessing the values from the request. Both the the annotations have the significant purpose and use respectively. The key difference between @RequestParam and @PathVariable is that @RequestParam used for accessing the values of the query parameters where as @PathVariable used for accessing the values from …
Spring Framework
Spring Annotations [Quick Reference]
Below is the summary of the spring annotations that people use most frequently across spring applications. Spring Framework 2.5 added the annotations to the framework. Before that, the XML files defined every configuration. Annotations became more convenient to reduce the XML configuration files and annotate the classes and methods with different annotations used at the …
Spring Boot Vs Dropwizard
It is always an interesting and exciting task to compare two popular frameworks. This time the contenders are two of the most popular microservices frameworks in Java. In this tutorial, I am going to compare the various aspects of Spring Boot and Dropwizard. I have been working on Spring Boot for almost a year and …
Spring Boot Configurations
Spring Boot uses application.properties or application.yml for configuring the various application level settings. As we are aware that spring boot works with the opinionated default values that are more sensible to your applications. Most of the time you may prefer to override the default values with your own configurations. In this tutorial I am going …
@RequestMapping Annotation in Spring MVC
@RequestMapping annotation is used for mapping web requests to particular handler classes or handler methods. The classes or methods that are annotated with @RequestMapping will be scanned and registered as the URI mappings for that specific class or method. Any future web requests will be redirected to that class or method. This annotation is part …
Firing Events at Spring Boot Startup
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 …