Jersey ContainerRequestFilter not triggered

后端 未结 10 694
囚心锁ツ
囚心锁ツ 2020-12-05 06:34

I\'m trying to use a ContainerRequestFilter to enforce some authentication on a Tomcat based Jersey application. I followed this document. Problem : the filter

10条回答
  •  难免孤独
    2020-12-05 07:13

    Okay, I didn't get that the jersey.config.server.provider.packages init param needs to reference not only service classes (API endpoints) but ALL the classes including filters.

    Now it works :

      
      jersey.config.server.provider.packages  
      com.hck.debate.rest.controller;com.hck.debate.rest.security
    
    
        com.sun.jersey.spi.container.ContainerRequestFilters
        com.hck.debate.rest.security.AuthFilter
    
    

提交回复
热议问题