*
The moose likes Spring and the fly likes DispatcherServlet Initilization stage. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "DispatcherServlet Initilization stage." Watch "DispatcherServlet Initilization stage." New topic
Author

DispatcherServlet Initilization stage.

Joy Vergis
Ranch Hand

Joined: Sep 14, 2009
Posts: 45
Hi,
I'm reading a tutorial for spring2.0 web mvc framework. Please help me to understand the below:


While initializing the DispatcherServlet it creates WebApplicationContext implementation class instance, either user configured custom class o the default XmlWebApplicationContext. The WebApplicationContext is responsible to locate the Spring Beans XML configuration file,then read,validate the configurations and details into configuration objects.


Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1648
    
    7

Sounds like a horrible tutorial. Why are you looking at Spring 2.0? Unless there is a good reason, try to focus on the newest Spring which is currently at 3.1.

If you want to know more about how Spring works the reference documentation is always the best place to start. If I can't find my answers there, well it is open source

Each DispatcherServlet has its own WebApplicationContext, which inherits all the beans already defined in the root WebApplicationContext. These inherited beans can be overridden in the servlet-specific scope, and you can define new scope-specific beans local to a given Servlet instance.
Upon initialization of a DispatcherServlet, Spring MVC looks for a file named [servlet-name]-servlet.xml in the WEB-INF directory of your web application and creates the beans defined there, overriding the definitions of any beans defined with the same name in the global scope.


[How To Ask Questions][Read before you PM me]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: DispatcherServlet Initilization stage.
 
Similar Threads
Relation between ContextLoaderListener application context and WebApplicationContext
JSP views rendering 0 bytes and HTTP 200
Integration testing of Spring 2.5 Annotation based controller using web context
getting Servletcontext in a class
Can I have multiple DispatcherServlet instantance.