7 Nisan 2017 Cuma

JAX-RS ContainerRequestFilter Arayüzü

Giriş
Şu satırı dahil ederiz.
import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.container.ContainerRequestFilter;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.SecurityContext;
import javax.ws.rs.ext.Provider;
import javax.annotation.Priority;
import javax.ws.rs.Priorities;
Tanımlama
Şöyle yaparız.
@Secured
@Provider
@Priority(Priorities.AUTHENTICATION)
public class AuthenticationFilter implements ContainerRequestFilter {...}
filter metodu
Şöyle yaparız.
@Overridepublic void filter(ContainerRequestContext requestContext)
  throws IOException {...}


Hiç yorum yok:

Yorum Gönder