[JBoss JIRA] (CDI-492) Give ownership of servlet specific part to servlet specification
by arjan tijms (JIRA)
[ https://issues.jboss.org/browse/CDI-492?page=com.atlassian.jira.plugin.sy... ]
arjan tijms commented on CDI-492:
---------------------------------
See CDI-709 for another more practical reason why the producers should live in the Servlet spec.
> Give ownership of servlet specific part to servlet specification
> ----------------------------------------------------------------
>
> Key: CDI-492
> URL: https://issues.jboss.org/browse/CDI-492
> Project: CDI Specification Issues
> Issue Type: Feature Request
> Components: Java EE integration
> Reporter: Antoine Sabot-Durand
> Fix For: 2.1 (Discussion)
>
>
> [Section 3.8 of the spec|http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#additional_builtin_...] places some requirements on CDI implementations when running with Servlet. To better suit user desires for modularity these requirements are better met by moving them to the Servlet spec. Specifically,
> {quote}
> A servlet container must provide the following built-in beans, all of which have qualifier @Default:
> * a bean with bean type {{javax.servlet.http.HttpServletRequest}}, allowing injection of a reference to the HttpServletRequest
> * a bean with bean type {{javax.servlet.http.HttpSession}}, allowing injection of a reference to the HttpSession,
> * a bean with bean type {{javax.servlet.ServletContext}}, allowing injection of a reference to the ServletContext,
> These beans are passivation capable dependencies, as defined in Passivation capable dependencies.
> {quote}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 6 months
[JBoss JIRA] (CDI-709) Should injecting the HttpServletRequest consider all used wrappers?
by arjan tijms (JIRA)
[ https://issues.jboss.org/browse/CDI-709?page=com.atlassian.jira.plugin.sy... ]
arjan tijms commented on CDI-709:
---------------------------------
This is indeed a very real problem and would be great if a solution could be found.
Relates to CDI-492
The issue is perhaps that using public Servlet APIs a CDI implementation can not guarantee it gets the last wrapped request. Only the Servlet container itself has this information. Also consider the case where the request is being injected into a bean called from a Servlet filter.
> Should injecting the HttpServletRequest consider all used wrappers?
> -------------------------------------------------------------------
>
> Key: CDI-709
> URL: https://issues.jboss.org/browse/CDI-709
> Project: CDI Specification Issues
> Issue Type: Clarification
> Components: Java EE integration
> Affects Versions: 2.0 .Final
> Reporter: Marcel Witte
>
> For example see this bug report of rewrite: https://github.com/ocpsoft/rewrite/issues/235
> If you inject the HttpServletRequest:
> {code:java}
> @Inject
> private HttpServletRequest request
> {code}
> then you do not get the latest created HttpServletRequestWrapper.
> If the wrapper is modifying the request (like adding parameters), these changes would not be visible to the application code using this injected request.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 6 months
[JBoss JIRA] (CDI-492) Give ownership of servlet specific part to servlet specification
by arjan tijms (JIRA)
[ https://issues.jboss.org/browse/CDI-492?page=com.atlassian.jira.plugin.sy... ]
arjan tijms commented on CDI-492:
---------------------------------
Coming back to this and reading this again, I'm not sure why everyone understands Greg's concerns. His concerns mostly seem to be about things that are not being asked:
>More over,
>GW> I'm concerned that by making CDI to servlet mapping a responsibility
>GW> of the servlet container
Greg seems to be concerned he has to initialise CD implementations, but that's not what's being asked here.
> then we are going to have to do a
>GW> container to CDI adaptation for every CDI implementation out there.
This is just not the case here. It's a complete non-concern. What's being asked is a built-in bean/producer for the HttpServletRequest and other types, which can be done by a portable extension.
>GW> The servlet specification already provides servlet container initializers,
GW> which have all the power required for CDI implementations to implement
GW> these CDI v Servlet cross concerns.
This clearly shows the mismatch of what Greg seems to think is being asked and what's actually being asked. A Servlet container initialiser of course has nothing to do with a built-in bean/producer for a certain type.
> Give ownership of servlet specific part to servlet specification
> ----------------------------------------------------------------
>
> Key: CDI-492
> URL: https://issues.jboss.org/browse/CDI-492
> Project: CDI Specification Issues
> Issue Type: Feature Request
> Components: Java EE integration
> Reporter: Antoine Sabot-Durand
> Fix For: 2.1 (Discussion)
>
>
> [Section 3.8 of the spec|http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#additional_builtin_...] places some requirements on CDI implementations when running with Servlet. To better suit user desires for modularity these requirements are better met by moving them to the Servlet spec. Specifically,
> {quote}
> A servlet container must provide the following built-in beans, all of which have qualifier @Default:
> * a bean with bean type {{javax.servlet.http.HttpServletRequest}}, allowing injection of a reference to the HttpServletRequest
> * a bean with bean type {{javax.servlet.http.HttpSession}}, allowing injection of a reference to the HttpSession,
> * a bean with bean type {{javax.servlet.ServletContext}}, allowing injection of a reference to the ServletContext,
> These beans are passivation capable dependencies, as defined in Passivation capable dependencies.
> {quote}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 6 months