Or simply inject UriInfo into your filter and ignore all requests but those which will match a certain URI pattern
Cheers, Sergey On 24/07/14 22:20, Sergey Beryozkin wrote:
Hi I guess you have few options. One option is to introduce multiple endpoints with unique addresses and fewer service beans as opposed to having a single endpoint with all the service beans. Another option is to use JAX-RS 2.0 Name Binding and attach a filter to individual method or class only. JAX-RS 2.0 DynamicFeature offers one more option. Cheers, Sergey On 24/07/14 20:23, javaworkinggirl wrote:The way my project is currently configuring rest services, all providers listed get used for all services. How can I get more fine grained configuration? I only want the headerValidationFilter used on the ecpCDRestServiceV1 rest service. Right now all the rest services are getting it. Note that we use a specific port of 8877 for our rest services. Can someone give me some suggestions? From applicationContext.mxl <jaxrs:server serviceName="ecpWebServices" address="http://0.0.0.0:8877"> <jaxrs:inInterceptors> <ref bean="validationInInterceptor"/> </jaxrs:inInterceptors> <jaxrs:outInterceptors> <ref bean="validationOutInterceptor"/> </jaxrs:outInterceptors> <jaxrs:serviceBeans> <ref bean="ecpAdminRestServiceV1"/> <ref bean="ecpApplicationRestServiceV1"/> <ref bean="ecpEntitlementRestServiceV1"/> <ref bean="ecpEntitlementRestServiceV2"/> <ref bean="ecpMetricsRestServiceV1"/> <ref bean="ecpAlertsRestServiceV1"/> <ref bean="ecpCDRestServiceV1"/> </jaxrs:serviceBeans> <jaxrs:providers> <bean class="com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider"/> <ref bean="genericRestExceptionMapper"/> <ref bean="customValidationExceptionMapper"/> <ref bean="headerValidationFilter"/> </jaxrs:providers> </jaxrs:server> Examples of rest service declarations: @Service @Path("/ecp/contentdirect/v1") @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) public class EcpCDRestServiceV1 { . . . @POST @Path("/entitlement") @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) @NotNull @Valid public Response postEntitlement(@Context final HttpServletRequest request,@NotNull @Valid final CsgEntitlement csgEntitlement) throws GenericRestException { . . . } } @Service @Path("/ecp/entitlements/v1") @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) public class EcpEntitlementRestServiceV1 { . . . @GET @Path("/entitlements") public Response getEntitlements(@Context final HttpServletRequest request, @QueryParam("divisionId") final String eisExDivDivisionId, @QueryParam("accountNumber") final String accountNumber, @QueryParam("recalculate") final Boolean recalculate) throws GenericRestException { . . . } } -- View this message in context: http://cxf.547215.n5.nabble.com/Configuration-problem-specific-rest-services-need-specific-providers-tp5746867.html Sent from the cxf-user mailing list archive at Nabble.com.
