
How to Configure Spring in web.xml file ?

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
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.