@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 Annotations
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 …
@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 …
@Profile Annotation in Spring 4
This tutorial explain how to enable profiles in your spring application for different environments. Also this tutorial explains the new improvements in the Spring 4.0 release and how it is different from the older releases. If you are working for a real time projects, it is often basic requirement to have the different environments like …
Spring MVC Annotations : @Component, @Repository, @Service
This tutorial explains the advantage of using the spring mvc annotations @Component, @Repository and @Service and how to use them. Spring Annotations are one of the nice feature to configure the Spring MVC applications. There are wide variety of annotations are define in the Spring Framework. In our earlier tutorials many of the most widely …
Spring : How To Load Properties File using @Value Annotation
This example shows how to load the properties file values using the @Value annotation. Accessing the property file values in the Spring application involves the following steps: Add the property file details to spring bean configuration file. You have to use the “classpath” prefix if you want to load the files from the classpath. Create …
@Import Annotation in Spring Framework
In my previous article I have explained about the JavaConfig in Spring 3.0. It is a new way of configuring the bean definitions without using the traditional XML files. Also I have listed the annotations defined as part of JavaConfig approach. If you are beginner in spring framework, we have huge collection of spring tutorials …
@Configuration Annotation in Spring 3.0
Spring 3.0 has introduced new way for configuring the spring beans. In fact this option was maintained by spring framework separately as JavaConfig project. Later this project is merged to the spring core framework and all the features are directly accessible from the spring core. If you are beginner in spring framework, we have huge collection …