ApplicationContext « MVC « Spring Q&A

1. can you explain to a layman what is a bean in the Spring ApplicationContext?

I'm walking through a spring mvc tutorial,and it says:

Controllers are managed exactly like any other bean in the Spring ApplicationContext

2. How to specify the default scope in Spring's applicationContext.xml to request scope?

I want to make all beans request scoped by default, however the Spring documentation says that the default scope is Singleton. (sections 3.4.1 and 3.4.2 I want to ...

3. Spring - using applicationContext.xml and XXXXX-servlet.xml

I am integrating Spring MVC into an existing project I have been working on. By integrating, I mean I am rewriting the project using Spring, and using much of my old ...

4. Spring - applicationContext.xml cannot be opened because it does not exist

I have a Spring MVC application and a problem with JUnit tests combined with the file applicationContext.xml. In my JUnit test class I write:

final ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
service = (TestServiceImpl) context.getBean("testServiceImpl");
The ...

5. Can a Spring bean be a property of itself in its declaration in applicationContext.xml?

I need to call public methods of the rubberStampService from inside the RubberStampServiceImpl class. To reference the rubberStampService from inside itself, can I make a self-referential bean declaration like this:

<beans:bean id="rubberStampService" class="com.rubberly.RubberStampServiceImpl">

6. Spring MVC and multiple applicationContext problem

Possible Duplicate:
@Service are constructed twice
i'm studying Spring MVC and i have a question about the applicationContext created by Spring. web.xml

7. Processing of *-context.xml and applicationContext.xml files in Spring application

I am using Spring Web MVC as frontend on hibernate with transactions (all annotation driven). I setup web.xml as follows:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"




8. add custom filter class in applicationcontext.xml

my application is using spring applicationContext.xml. i have a custom filter class ( CustomFilter implements Filter) that i want to use in my application . Is the proper way to do ...

9. ApplicationContext file in Spring MVC

What is the use of the ApplicationContext.xml file in Spring MVC. I did not get it. I tried to search on internet but no help. Thanks

10. Can't Import applicationContext in test class

my applicationContext.xml,webmvc-config.xml are in WEB-INF/spring/applicationContext.xml when i try the following, it doesn't load, and i get

@ContextConfiguration(locations = { "classpath:WEB-INF/spring/applicationContext.xml" })
i am using spring 3, junit 4.7. it works with the dirty workaround ...

11. Getting null value from applicationcontext.xml

I am working on struts2 application with spring for back end.
We are using file and the entries are as follows:

I added the following new ...

12. Is there any way to enable or disable the Spring bean definition in applicationContext.xml file?

Is there any way to enable or disable a java bean definition in application context?

<bean id="enBean" classs="com.en.bean.BeanName">
   <property name="prop1"/>
Or, is there any way to load the bean conditionally defined ...