Top "Spring-annotations" questions

A common placeholder for issues related to the use of annotations with the Spring framework

Custom Spring annotation for request parameters

I would like to write custom annotations, that would modify Spring request or path parameters according to annotations. For example …

java spring spring-mvc spring-annotations request-mapping
Is the @Query annotation in spring SQL Injection safe?

Do the parameters of a string passed to the @Query annotation, for Spring, get treated as pure data as they …

java spring sql-injection spring-annotations
Reference an Annotated Spring Component in an XML Bean Definition

I am using an external library that requires that I configure it using an XML Bean definition; in the Bean …

spring spring-3 spring-annotations
Spring @Value annotated method, use default value when properties not available

Situation I am injecting properties from .properties file into fields annotated with @Value. However this properties present sensitive credentials, so …

java spring spring-boot spring-annotations properties-file
How to do Spring Lookup Method Injection with Annotations?

Is there any way to use Lookup Method Injection using annotations? Given the following class: @Service public abstract class A { …

spring dependency-injection spring-annotations
Inject a list of beans using Spring @Configuration annotation

I've got a Spring bean, and in the Spring Bean I have a dependency on a list of other beans. …

java spring spring-annotations
Using Spring cache annotation in multiple modules

I have a util module that produces a jar to be used in other applications. I'd like this module to …

spring caching annotations ehcache spring-annotations
Is it possible to guarantee the order in which @PostConstruct methods are invoked?

I have a system which is using Spring for dependency injection. I use annotation-based autowiring. The beans are discovered by …

java spring spring-annotations
Spring Boot : Custom Validation in Request Params

I want to validate one of the request parameters in my controller . The request parameter should be from one of …

spring-boot validation controller spring-annotations http-request-parameters
What is the proper way to activate @PostConstruct via CommonAnnotationBeanPostProcessor by Java configuration?

I'm using Spring 4 with SpringBoot and Spring-Web with Java configuration. To have my @PostConstruct annotated methods executed by Spring at …

spring spring-annotations