{"action":"created","issue":{"url":"https://api.github.com/repos/HubSpot/dropwizard-guice/issues/33","labels_url":"https://api.github.com/repos/HubSpot/dropwizard-guice/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/HubSpot/dropwizard-guice/issues/33/comments","events_url":"https://api.github.com/repos/HubSpot/dropwizard-guice/issues/33/events","html_url":"https://github.com/HubSpot/dropwizard-guice/issues/33","id":40822929,"number":33,"title":"Support ContainerRequestFilters and ContainerResponseFilters","user":{"login":"piersy","id":5087847,"avatar_url":"https://avatars.githubusercontent.com/u/5087847?v=3","gravatar_id":"","url":"https://api.github.com/users/piersy","html_url":"https://github.com/piersy","followers_url":"https://api.github.com/users/piersy/followers","following_url":"https://api.github.com/users/piersy/following{/other_user}","gists_url":"https://api.github.com/users/piersy/gists{/gist_id}","starred_url":"https://api.github.com/users/piersy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piersy/subscriptions","organizations_url":"https://api.github.com/users/piersy/orgs","repos_url":"https://api.github.com/users/piersy/repos","events_url":"https://api.github.com/users/piersy/events{/privacy}","received_events_url":"https://api.github.com/users/piersy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-08-21T16:32:14Z","updated_at":"2015-03-28T12:33:12Z","closed_at":null,"body":"At present I'm storing the injector in a filed inside the application class and then manually registering the request filter in the run method as such.\r\n```\r\n@Override\r\npublic void run(RegistrationServiceConfiguration configuration, Environment environment) throws IOException {\r\nenvironment.jersey().getResourceConfig().getContainerRequestFilters().add(guiceBundle.getInjector().getInstance(DeviceDataExtractionFilter.class));\r\n. . .\r\n}\r\n```\r\n\r\nIt would be great if this could be auto discovered and injected similarly to the resource classes.\r\n"},"comment":{"url":"https://api.github.com/repos/HubSpot/dropwizard-guice/issues/comments/87219404","html_url":"https://github.com/HubSpot/dropwizard-guice/issues/33#issuecomment-87219404","issue_url":"https://api.github.com/repos/HubSpot/dropwizard-guice/issues/33","id":87219404,"user":{"login":"yunspace","id":218128,"avatar_url":"https://avatars.githubusercontent.com/u/218128?v=3","gravatar_id":"","url":"https://api.github.com/users/yunspace","html_url":"https://github.com/yunspace","followers_url":"https://api.github.com/users/yunspace/followers","following_url":"https://api.github.com/users/yunspace/following{/other_user}","gists_url":"https://api.github.com/users/yunspace/gists{/gist_id}","starred_url":"https://api.github.com/users/yunspace/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yunspace/subscriptions","organizations_url":"https://api.github.com/users/yunspace/orgs","repos_url":"https://api.github.com/users/yunspace/repos","events_url":"https://api.github.com/users/yunspace/events{/privacy}","received_events_url":"https://api.github.com/users/yunspace/received_events","type":"User","site_admin":false},"created_at":"2015-03-28T12:33:12Z","updated_at":"2015-03-28T12:33:12Z","body":"You can also add `@Provider` annotation to your filters since that's what `AutoConfig` looks for. Works pretty well for our use cases. For example:\r\n\r\n    @Singleton\r\n    @Provider\r\n    public class CrossDomainFilter implements ContainerResponseFilter {\r\n        private static final int ACCESS_CONTROL_MAX_AGE_IN_SECONDS = 12 * 60 * 60;\r\n\r\n        @Override\r\n        public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException {\r\n            ....\r\n        }\r\n    }\r\n\r\n@HiJon89 If the user has resolved this issue, this should be closed?"}}