For Struts2 , we simply add this line inside web.xml
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
But could anybody please tell me , how it will know the path of struts.xml file ??
Struts2 looks for the struts.xml file at the root of the classpath. You can override the location using the
configinit param, if needed.The actual configuration is set up by the
Dispatcherclass, irrespective of whether you use the olderFilterDispatcheror the newerStrutsPrepareAndExecuteFilter.