Antoine,
Definitely a good idea. I also reached out to Ed/Servlet EG recently about CDI-452. If we can schedule this meeting, I'd like to include 452 on the topic to make sure there's no crossed wires (I haven't read the full response yet, but I suspect there will still be questions).
John
Hello Antoine,
When I briefly bumped into you at JavaOne, you expressed a desire to
revisit this issue. Since we didn't make time to meet at JavaOne, I am
following up over email.
Way back at the beginning of Servlet 4.0, I attempted to get this one
resolved. We filed two JIRAS, as in the subject, and had some
discussion [1] [2]. We ended up resolving SERVLET_SPEC_116 as
WORKS_AS_DESIGNED for this reason, the "classloader and backward
compatibility concern":
>>>>> On Wed, 19 Nov 2014 15:55:43 -0500 (EST), Stuart Douglas <sdouglas@redhat.com> said:
SD> Say I have an application that packages Weld (or OWB) that I have
SD> deployed on a Servlet 3.1 container, and I now want to move it to a
SD> Servlet 4.0 container. The older version of Weld will still provide
SD> the HttpServletRequest beans (as it is required to do by spec) and
SD> the servlet container will also provide these beans (as we are
SD> required to do by spec) and as a result if you try and inject them
SD> you will get a bean resolution error as two beans resolve to the
SD> injection point.
>>>>> On Fri, 21 Nov 2014 14:06:24 +1100, Greg Wilkins <gregw@intalio.com> said:
GW> While initially I thought that the words "when running in an
GW> environment that also supports CDI..." would be sufficient to make
GW> this OK, I'm now doubting that. I share Stuarts concerns about
GW> classloading confusion.
>>>>> On Fri, 21 Nov 2014 07:03:33 -0800, Edward Burns <edward.burns@oracle.com> said:
EB> Ajran, while your observations are accurate, the backward
EB> compatibility issues raised by Stuart and seconded by Greg are
EB> showstoppers for this change in my opinion at this point.
There was an additional concern, the "portable implementation concern":
it is not possible to provide portable implementations of the code
necessary to implement the new requirements that would be in the Servlet
spec, taken from CDI section 3.8:
CDI3.8> A servlet container must provide the following built-in
CDI3.8> beans, all of which have qualifier @Default:
CDI3.8> a bean with bean type javax.servlet.http.HttpServletRequest,
CDI3.8> allowing injection of a reference to the HttpServletRequest
CDI3.8> a bean with bean type javax.servlet.http.HttpSession,
CDI3.8> allowing injection of a reference to the HttpSession,
CDI3.8> a bean with bean type javax.servlet.ServletContext, allowing
CDI3.8> injection of a reference to the ServletContext,
CDI3.8> These beans are passivation capable dependencies, as defined
CDI3.8> in Passivation capable dependencies.
In my understanding, the portable implementation concern has been adequately
addressed by API in CDI 2.0. Is that correct?
Do you have any suggestion for how to address the classloader and
backward compatibility concern?
Thanks,
Ed