Spring ApplicationContextUtil - basic

Posted on 2009-02-19
Medium Priority
Last Modified: 2013-11-11

I am doing a prototype with spring and i wrote a ApplicationContextUtil.java tat loads the context file of my project. So i got few questions on that,

1. I was asked to use Introspecter.flushCaches on context destroy. My question is what is this Introspector and where we need to use it. I checked some sites and i didnt get a proper explanation.

2. servletContextEvent.getServletContext().setAttribute("org.springframework.web.context.WebApplicationContext.ROOT",applicationContext);

wat is the purpose of the above attribute and wht it does?

Question by:Murali Murugesan
  • 3
  • 2
LVL 13

Author Comment

by:Murali Murugesan
ID: 23690215
Thanx for ur reply objects,

I referred to the same site for Introspector - i could make out that it is an API which IDE (java based) would make use of to list the properties and methods in a bean. But my question is how it is related to the loading of Spring context file in my application?. I would like to know the reason for using it.

Similarly y is this Context root used, what would happen if i dont give it..

LVL 92

Accepted Solution

objects earned 300 total points
ID: 23690250
Spring is all about beans, and the Introspector is part of the standard Java beans api that comes with java. The flushCaches() method is used to clear all the bean info stored by that package. Part of the cleanup process.

LVL 13

Author Comment

by:Murali Murugesan
ID: 23690291
Ok. so what is the significance of this


what would happen if i dont give it.If i have to specify it then why?

LVL 92

Expert Comment

ID: 23690301
the servlet context would not know where to find the application context


Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
The viewer will learn how to implement Singleton Design Pattern in Java.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month14 days, 15 hours left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question