Questions tagged [spring-3]

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

The Spring Framework is an open source application framework for the Java platform. Use for general Spring related questions. This tag is for questions that are specific to versions 3.x only.

It provides services and functionality across the application domain, including a core Inversion of Control container, technology-agnostic data-access and MVC layers, extensive AOP support, task scheduling, and various integration patterns designed to make distributed system development simpler and clearer. While some spring modules are simple wrappers and helpers over the Java EE specifications, the majority of them go far beyond the Java EE specification.

The latest Spring Framework Reference Documentation can be found here.

Frequently Asked Questions

People often ask about the following Spring topics:

###Guides:

Video tutorial on Spring Framework

###Blog:

Related tags

###More information:

762 questions
16
votes
5 answers

difference between @Component and @Configuration in Spring 3

I came across two annotations provided by Spring 3 (@Component and @Configuration) I am a bit confused between these. Here is what I read about @Component Put this “context:component” in the bean configuration file, it means, enable the…
Anand
  • 20,708
  • 48
  • 131
  • 198
16
votes
1 answer

"The matching wildcard is strict, but no declaration can be found for element 'http'" Error

I am trying to configure NTLM authentication, but receive error: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'http'. I read a lot of topics with a similar error, but I could not find a…
DmitryB
  • 1,149
  • 5
  • 20
  • 34
15
votes
2 answers

Spring: Attaching @Qualifer to Java-configured beans

In spring, you can XML-configure a bean to have a qualifier. I can't seem to find how I can attach a qualifier if configuring beans through Java annotations. What's up with that? Do I have to use just plain old names?
Aleksandr Dubinsky
  • 22,436
  • 15
  • 82
  • 99
15
votes
2 answers

Spring MVC 3 : Ambiguous mapping found

I am playing with spring MVC 3.1 and testing different features. I wanted to verify following statement taken from @RequestMapping#value doc If you have a single default method (without explicit path mapping), then all requests without a more…
Amit Patel
  • 15,609
  • 18
  • 68
  • 106
15
votes
6 answers

How to use property from property file specified in PropertyPlaceholderConfigurer in JSP

In my application context I have defined properties file: I want to get value of the property defined in that file on JSP page. Is there a way to do that in the way…
glaz666
  • 8,707
  • 19
  • 56
  • 75
15
votes
5 answers

How update/remove an item already cached within a collection of items

I am working with Spring and EhCache I have the following method @Override @Cacheable(value="products", key="#root.target.PRODUCTS") public Set findAll() { return new LinkedHashSet<>(this.productRepository.findAll()); } I have other…
Manuel Jordan
  • 15,253
  • 21
  • 95
  • 158
14
votes
1 answer

How can I authenticate a system user for scheduled processes in Spring?

we have a Quartz/Spring Batch job, that for audit logging purposes we'd like to have it "authenticated" as a system user. Some of our methods rely on fetching the SecurityContext to do this. The ways of running this job are trusted (or…
xenoterracide
  • 16,274
  • 24
  • 118
  • 243
14
votes
1 answer

Spring bean instantiation by passing constructor args?

I have below spring bean. public class Employee2 { private int id; private String name; private double salary; public Employee2(int id, String name, double salary) { this.id = id; this.name = name; this.salary = salary; } …
user755806
  • 6,565
  • 27
  • 106
  • 153
14
votes
2 answers

How to perform logout programmatically in spring 3

I have a spring configuration for logout like follows: Now I want to do programmatically logout. How I can achieve this in Spring 3. I need to do logout from one of my…
Saurabh Kumar
  • 16,353
  • 49
  • 133
  • 212
14
votes
8 answers

Dynamic css not applied in my menu (tiles + spring 3.0)

I am using Spring 3.0 + tiles. I have created the common menu with anchor tag for all the pages and applied the css for the same. I am using Jquery for dynamically changing the css class for the menu when the menu is clicked. When the menu/link is…
Amee Mehta
  • 159
  • 1
  • 11
14
votes
3 answers

How to Pass custom objects using Spring's REST Template

I have a requirement to pass a custom object using RESTTemplate to my REST service. RestTemplate restTemplate = new RestTemplate(); MultiValueMap requestMap = new LinkedMultiValueMap(); ... requestMap.add("file1",…
ASChakkalakal
  • 459
  • 2
  • 8
  • 18
13
votes
5 answers

Best Practise of injecting applicationContext in Spring3

As in the title above, I am confused about pros cons between injecting applicationContext by directly @Autowired annnotation or implementing ApplicationContextAware interface in a singleton spring bean. Which one do you prefer in which cases and…
javatar
  • 4,542
  • 14
  • 50
  • 67
13
votes
3 answers

How to generate URI inside a controller in Spring 3

I use spring 3.0 and I have a really simple question but didn't find any answer on the internet. I want to generate a path (an URI) just like in my JSPs: But inside a controller. What is the related service to…
Nanocom
  • 3,696
  • 4
  • 31
  • 46
13
votes
2 answers

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 am having. I have a validator that looks like this: @Component public class UniqueUsernameValidator implements…
Vivin Paliath
  • 94,126
  • 40
  • 223
  • 295
13
votes
8 answers

ResponseEntityExceptionHandler is not getting called when exception occurs

I am new to spring. I am developing a REST api with spring webmvc. For Error Handling I got this link http://docs.spring.io/spring/docs/3.2.x/spring-framework-reference/html/mvc.html#mvc-ann-rest-spring-mvc-exceptions I have tried to use…
Harshal
  • 193
  • 1
  • 2
  • 9