SpringMVC Classroom image

Anil  Bist / Professional / Web Technology
 
To post your Question Join Classroom
 
Question No  (9 of 17)
First 5 I 6 I 7 I 8 I 9 I 10 I 11 I 12 I 13 Last
 
Question:-
What is DispatcherServlet and ContextLoaderListener?
 
Answer:-
<web-app>
  <display-name>Archetype Created Web Application</display-name>
   
  <servlet>
        <servlet-name>spring</servlet-name>
            <servlet-class>
                org.springframework.web.servlet.DispatcherServlet
            </servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
 
    <servlet-mapping>
        <servlet-name>spring</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>
     
</web-app>

DispatcherServlet loads its configuration file using <servlet_name>-servlet.xml. E.g. with above web.xml file, DispatcherServlet will try to find spring-servlet.xml file in classpath.

ContextLoaderListener reads the spring configuration file (with value given against “contextConfigLocation” in web.xml), parse it and loads the beans defined in that config file

<servlet>
    <servlet-name>spring</servlet-name>
    <servlet-class>
        org.springframework.web.servlet.DispatcherServlet
    </servlet-class>
     
    <init-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/applicationContext.xml</param-value>
    </init-param>
     
    <load-on-startup>1</load-on-startup>
</servlet>

 

  
 
 
 
image
Anil  Bist

Skills    SpringMVC

Qualifications :- High School - SLV, College/University - Graphic Era Deemed Univ University,
Location :-Dehradun,Dehradun,Uttarakhand,
Description:-

in 2006, i Join a web development company in Bangalore and start work on "Ruby on Rail" this is my first web development framework and we worked in this framework and develop four to five project after some time , I moved to JEE/Sturst frame work,

After some time i decided that now times come and I have to go on in my own way and I started a company name is "Soarlogic&q
Explore

 

  Students (7)

Ask 
image
Daljit
Ask 
image
Daljit
Ask 
image
Neeraj
Ask 
Sunil
Ask 
Neha
Ask 
image
prateek
Ask 
image
Anil
 
 

Recommended Classes

sonali uniyal
Professional
image shubham rauthan
I am a b.tech graduate in Information Technology and working as a Software Engineer and i wo...
Professional
image shubham rauthan
I am a b.tech graduate in Information Technology and working as a Software Engineer and i wo...
Professional