Monday, June 23, 2008

Configuring struts for your Web Application

Configuring struts in your web application is pretty simple. You have to add a filter in you web.xml file:-


<filter>
<filter-name>struts</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
</filter>



And then provide appropriate mapping, like:-



<filter-mapping>
<filter-name>struts</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>


So, now every url will be passed through the struts filter.

Hope you find it useful.
Thanks.

No comments: