Top "Spring-3" questions

Version 3.x of the Spring Framework, use [tag:spring] for general Spring related questions.

Resolve Spring @Value expression in JUnit tests

Here's a snippet of a Spring bean: @Component public class Bean { @Value("${bean.timeout:60}") private Integer timeout; // ... } Now I want …

java spring junit junit4 spring-3
How to pool objects in Spring?

I'm following this tutorial regarding how to pool objects in Spring. I've followed the instruction written on the tutorial but …

java spring spring-3 spring-aop pooling
Why unit testing with Spring 3.1 WebMvcConfig fails?

From Spring 3.1, we can use JavaConfig more easily thanks to @Enable* annotations. So I made a WebConfig to set WebMvc …

java spring spring-3
java.lang.IllegalStateException: File has already been moved - cannot be transferred again

I am trying to upload a file and save it on server. But I get: java.lang.IllegalStateException: File has …

java spring-mvc file-upload spring-3 apache-commons-fileupload
Is there any way to override a bean discovered by component scan?

I have a java configuration class providing fooBean directly and barBean by component scan. @Configuration @ComponentScan(basePackages = { "com.blah" }) public …

spring dependency-injection spring-3 spring-annotations
Configure two @InitBinder to work with the same Model or Entity but for different @RequestMappings

I have a controller where works fine, It can register and update an entity, just how the following about to …

spring spring-mvc spring-3 spring-4 spring-mvc-initbinders
@Autowired by constructor looks for beans by type. How to inject a bean by name to a constructor using autowired annotation

@Autowired by constructor looks for beans by type. How to inject a bean by name to a constructor using autowired …

spring-annotations spring-3
When to use transactions in Spring with Hibernate?

Upgrading my project I'm thinking here about transactions. Well, the thing is I'm not quite sure when should I use …

java spring-3 spring-transactions hibernate3
Autowiring a service into a validator

This example is a bit contrived; I've simplified it to remove extraneous details and to focus on the problem I …

spring validation hibernate-validator autowired spring-3
How to test POST spring mvc

My problem is to how to call this. I could do MyObject o = new MyObject(); myController.save(o, "value"); but …

spring-mvc spring-3 spring-test spring-test-mvc