ApplicationContext « MVC « Spring Q&A





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

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?    stackoverflow.com

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 http://static.springsource.org/spring/docs/2.5.x/reference/beans.html) I want to ...

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

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    stackoverflow.com

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?    stackoverflow.com

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    stackoverflow.com

Possible Duplicate:
@Service are constructed twice
i'm studying Spring MVC and i have a question about the applicationContext created by Spring. web.xml
<context-param>
    <param-name>contextConfigLocation</param-name>
  ...

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

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"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
    http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

<display-name>wdman</display-name>

<session-config>
    <session-timeout>30</session-timeout>
</session-config>

<context-param>
 ...

8. add custom filter class in applicationcontext.xml    stackoverflow.com

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    stackoverflow.com

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    stackoverflow.com

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 java.io.FileNotFoundException

@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    stackoverflow.com

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

jdbc.url=jdbc:mysql://localhost:3306/myDb  
jdbc.username=root  
jdbc.password=rooooot  
jdbc.csvlocation=C:\myCSV
I added the following new ...

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

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"/>
</bean>
Or, is there any way to load the bean conditionally defined ...