Request filter changes from 6.9.4 to 6.10.3? (implementation question)

Enonic version: 6.10.3
OS: RHEL

We have an application that uses a request filter. But after upgrading from enonic 6.9.4 to 6.10.3 it no longer works. Has anything obvious changed that would make our filter stop working, dependencies or the way you implement it?
If not, how would you go about implementing a request filter for enonic 6.10/6.11?

Our filter is currently a class that extends OncePerRequestFilter and overrides doHandle.
This is a solution built by some developers that aren’t working on the project anymore, so I’m sort of stumped on how to debug this.

Edit: clarified some more

I tried using a filter in 6.11.0 and it seems pretty straight forward. Just have a look at the VirtualHostFilter that comes with XP: https://github.com/enonic/xp/blob/5b5e0258698a43550e52ae8a86528b8b2b32c304/modules/web/web-vhost/src/main/java/com/enonic/xp/web/vhost/impl/VirtualHostFilter.java

Just add this to your build.gradle file and you can compile your own filter
compile “com.enonic.xp:web-api:6.11.0”
compile “com.enonic.xp:web-vhost:6.11.0”
compile “javax.servlet:javax.servlet-api:3.0.1”

2 Likes

Thank you! That’s just what I needed, the previous implementation was using the wrong annotation :slight_smile:

1 Like