Atark Atark - 1 month ago 16x
Java Question

How to configure URL patterns to have servlet and Struts2 to work simultaneously?

Why my filtering does not work for me and how to setup it to work?

There is my


<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="" xmlns:xsi="" xsi:schemaLocation="">


On this configuration
does not receive anything and web server reports that there are no action mapping for

If I comment filter-mapping this servlet works fine by this URL.

How to get working Struts filters and servlet filter simultaneously, the point is servlet should work only with
URL, all others should be processed by Struts. I cannot understand how to create URL patterns for my case.


You should add excludePattern constant to struts.xml to exclude servlet mapping URL from Struts processing.

    <constant name="struts.action.excludePattern" value="/gameservlet/?.*"/>