How to Configure Spring in web.xml file ?

How to Configure Spring in web.xml file ?

How to Configure Spring in web.xml file ?

View Answers

October 10, 2011 at 3:20 PM

Hi you need to map the DispatcherServlet in web.xml as

    <servlet>
        <servlet-name>dispatcherServlet</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>dispatcherServlet</servlet-name>
        <url-pattern>*.htm</url-pattern>        
    </servlet-mapping>

Note;- The DispatcherServlet file name should be dispatcherServlet-servlet.xml if you write dispatcher then Dispatcher Servlet xml file name would be

dispatcher-servlet.xml









Related Tutorials/Questions & Answers:

Ads