I have a Struts2 (2.1.8.1) web application. My web.xml looks like,
<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>
This is configured to map all requests to the struts filter. I want to add a servlet in my web application. I want to send all requests with a certain url pattern to that servlet. I want everything else to go to my struts servlet.
I know I could only map "*.action" to the struts servlet, but I hate .action being on the end of all my URL's.
In your struts.xml add:
<constant name="struts.action.excludePattern" value="/ServletToExcludeFromStruts*"/>
The value be comma delimited as well for multiple exclusions. See http://struts.apache.org/2.2.1/docs/webxml.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With