Top "Spring-annotations" questions

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

Populating Spring @Value during Unit Test

I'm trying to write a Unit Test for a simple bean that's used in my program to validate forms. The …

java spring junit spring-annotations
What does the @Valid annotation indicate in Spring?

In the following example, the ScriptFile parameter is marked with an @Valid annotation. What does @Valid annotation do? @RequestMapping(value = "/…

java spring spring-mvc spring-annotations
Is there a way to @Autowire a bean that requires constructor arguments?

I'm using Spring 3.0.5 and am using @Autowire annotation for my class members as much as possible. One of the beans …

spring constructor autowired spring-annotations spring-bean
Spring MVC @PathVariable with dot (.) is getting truncated

This is continuation of question Spring MVC @PathVariable getting truncated Spring forum states that it has fixed(3.2 version) as part …

spring rest spring-mvc spring-annotations
@Autowired - No qualifying bean of type found for dependency at least 1 bean

Currently I'm facing an issue in Autowire configuration between controller and the service layer. I'm unable to trace my mistakes. …

spring spring-mvc spring-annotations
Spring Boot @Value Properties

I have a Spring Boot application and in one of the classes, I try to reference a property from the …

spring spring-boot spring-annotations
How to inject a Map using the @Value Spring Annotation?

How can i inject values into a Map from the properties file using the @Value annotation in Spring ? My Spring …

java spring dependency-injection annotations spring-annotations
Spring 4 - addResourceHandlers not resolving the static resources

My maven spring project directory structure is shown below. I am using Spring-4 annotation based configuration. I configure the resources …

java spring spring-mvc spring-annotations spring-4
How to register Spring @Configuration annotated class instead of applicationContext.xml file in web.xml?

I am using jsf and spring together in web application. I have configured datasource and session factory in one configuration …

java spring spring-3 spring-annotations
Is it possible to set a bean name using annotations in Spring Framework?

I have a bean like this: @Bean public String myBean(){ return "My bean"; } I want to autowire it: @Autowired @Qualifier("…

java spring spring-mvc spring-annotations spring-bean