I have multiple filters in my application, with one at the root.
<filter>
<filter-name>root</filter-name>
<filter-class>
my.own.classpath.RootFilter
</filter-class>
</filter>
<filter>
<filter-name>root</filter-name>
<filter-class>
my.own.classpath.SubFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>root</filter-name>
<url-pattern>/</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>sub</filter-name>
<url-pattern>/sub/*</url-pattern>
</filter-mapping>
In Scalatra 2.0.0 this worked fine. If RootFilter (which extends ScalatraFilter) had a binding for a url it would handle it, otherwise it would pass on to the other filters. However, in later versions of Scalatra it does not work the same. When I supply a url handled by SubFilter, the correct filter is still called, but the resulting text is not displayed. Instead, a blank page (with no HTML) is returned.
Is this a bug in Scalatra, or am I doing something wrong?
I’m not sure, Scalatra does not move at Java pace, so things change.
Here’s an a snippet from the Scalatra Book v2.0 on ScalatraServlet vs. ScalatraFilter; there may be some clue here as to where the problem lies, particularly in regard to Not Found and ScalatraFilter delegating to the next filter in the chain (in your case, there is no next filter after sub)