@Override protected HttpServletRequest newInstance(InjectionPoint ip, CreationalContext<HttpServletRequest> creationalContext) { try { Context context = getBeanManager().getContext(RequestScoped.class); if (context instanceof HttpRequestContextImpl) { return Reflections.<HttpRequestContextImpl> cast(context).getHttpServletRequest(); } throw ServletLogger.LOG.cannotInjectObjectOutsideOfServletRequest(HttpServletRequest.class.getSimpleName(), null); } catch (ContextNotActiveException e) { throw ServletLogger.LOG.cannotInjectObjectOutsideOfServletRequest(HttpServletRequest.class.getSimpleName(), e); } }
@Override protected HttpServletRequest newInstance(InjectionPoint ip, CreationalContext<HttpServletRequest> creationalContext) { try { Context context = getBeanManager().getContext(RequestScoped.class); if (context instanceof HttpRequestContextImpl) { return Reflections.<HttpRequestContextImpl> cast(context).getHttpServletRequest(); } throw ServletLogger.LOG.cannotInjectObjectOutsideOfServletRequest(HttpServletRequest.class.getSimpleName(), null); } catch (ContextNotActiveException e) { throw ServletLogger.LOG.cannotInjectObjectOutsideOfServletRequest(HttpServletRequest.class.getSimpleName(), e); } }
@Override protected HttpServletRequest newInstance(InjectionPoint ip, CreationalContext<HttpServletRequest> creationalContext) { try { Context context = getBeanManager().getContext(RequestScoped.class); if (context instanceof HttpRequestContextImpl) { return Reflections.<HttpRequestContextImpl> cast(context).getHttpServletRequest(); } throw ServletLogger.LOG.cannotInjectObjectOutsideOfServletRequest(HttpServletRequest.class.getSimpleName(), null); } catch (ContextNotActiveException e) { throw ServletLogger.LOG.cannotInjectObjectOutsideOfServletRequest(HttpServletRequest.class.getSimpleName(), e); } }