Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Application context in spring

 
Ranch Hand
Posts: 238
1
Eclipse IDE Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hi all,
I have a configuration file as follows:-



In the given application,I am no where using the following line :
ApplicationContext context=new ClassPathXmlApplicationContext(resource);
but still have my application working just fine.
On searching i found that
1:It is the ContextLoaderListener who is actually loading the xml files in classpath,and
2: the beans inside the xml file are automatically generated by the container.
The doubt i have is,that,does the container creates the beans simply by loading the xml files?just like that!!or do we have to initialise the ApplicationContext by using the Resource class as parameter to the constructor as follows:
ApplicationContext context=new ClassPathXmlApplicationContext(resource);

I am a bit confused on these concepts.Please guide me through.

Thanks...
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Closing because this is a duplicate thread.

Mark
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic