Description
I tried to wrap HttpServletRequest by using ContextProvider, lets assume such a simple implementation:
@Provider
public class CustomHttpRequestContextResolver implements ContextResolver<CustomHttpRequest> {
@Context
private HttpServletRequest request;
public CustomHttpRequest getContext(Class<?> type)
{ return new CustomHttpRequest(request); }}
However, before calling context provider CXF first calls JAXRSUtils.createServletResourceValue() method that tries to cast HttpServletRequest into my wrapped request and it fails with ClassCastException.
I havent found in JAX_RS spec anything telling that such a ContextResolver is forbidden.This works also with Apache Wink.