• Post Reply 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:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Relation between ContextLoaderListener application context and WebApplicationContext

 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
Suppose I create an application context using ContextLoaderListener. And I am using Spring MVC. The DispatcherServlet is also having its WebApplicationContext. What is the relationship between these two application contexts.

Thanks,
Ganesh
 
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The WebApplicationContext of DispatcherServlet inherits the beans defined in the root WebApplicationContext.
You can read http://static.springsource.org/spring/docs/2.5.6/reference/mvc.html for more information.
 
Ganesha Kumar
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are there 2 Spring containers one created by ContextLoaderListener and another by DispatcherServlets? If yes, then if the beans in the rootAppplicationContext are inherited by the WebApplicationApplication, do they live in 2 Containers?

Thanks,
Ganesh
 
Hong Anderson
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From the documentation, yes. You can have a look at source code if you're really curious.
 
Ranch Hand
Posts: 689
Scala Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The DispatcherServlet provides a gateway to the server and every request of the application workflow involved with HTTP-based request-response handling done by DispatcherServlet.

WebApplicationContext is a special type of context. And it is combine with dispatcher servlet and manages all components as controllers, mappings between URLs, and interceptors, views.

WebApplicationContext doesn't much difference from normal ApplicationContext.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic