• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1596
  • Last Modified:

Spring ApplicationContextUtil - basic

Hi,

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?


-Murali*
0
Murali Murugesan
Asked:
Murali Murugesan
  • 3
  • 2
1 Solution
 
Murali MurugesanFull stack Java developerAuthor Commented:
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..

-Murali*
0
 
objectsCommented:
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.

0
 
Murali MurugesanFull stack Java developerAuthor Commented:
Ok. so what is the significance of this

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

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

-Murali*
0
 
objectsCommented:
the servlet context would not know where to find the application context

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now