Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jaxrs-dev] Integrating JAX-RS, CDI and bean validation



On Tue, Feb 27, 2018 at 10:10 AM, Christian Kaltepoth <christian@xxxxxxxxxxxx> wrote:

The HttpServletRequest injection also works. But I could not find anything in the spec, that indicates that the CDI request scope is actually active while a JAX-RS request is executed. Is this up to the implementors to decide?

Well, the CDI request scope is always active for HTTP requests. So that's basically not something the JAX-RS implementor could change, even if he wants to. ;-)

It's slightly more subtle. This scope is active:

  • during the service() method of any servlet in the web application, during the doFilter() method of any servlet filter and when the container calls any ServletRequestListener or AsyncListener,
  • during any Java EE web service invocation,
  • during any asynchronous observer method notification,
  • during any remote method invocation of any EJB, during any asynchronous method invocation of any EJB, during any call to an EJB timeout method and during message delivery to any EJB message-driven bean, and
  • during any message delivery to a MessageListener for a JMS topic or queue obtained from the Java EE component environment.
The question is, is a JAX-RS invocation a "Java EE web service invocation", or does that only hold for the JAX-WS stuff? I seem to remember that it's JAX-WS, but I'd have to double check.

Additionally, HttpServletRequest is from the Servlet spec, but isn't (unfortunately) JAX-RS technically Servlet independent?

Kind regards,
Arjan Tijms



 


Christian


--

_______________________________________________
jaxrs-dev mailing list
jaxrs-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jaxrs-dev



Back to the top