I would like to know why the web.xml for Struts2 and Spring MVC are different.
Both frameworks use "front controller" MVC pattern in my understanding, but Struts2 uses a Filter and Spring MVC uses a Direct declaration of a servlet in the web.xml?
Doesn't Struts use servlets as well ? If it does then how is it that that servlet is not declared in the web.xml as it is for Spring ?
Spring MVC:
<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>
Struts2:
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>