[cdi-dev] [JBoss JIRA] (CDI-709) Should injecting the HttpServletRequest consider all used wrappers?

arjan tijms (JIRA) issues at jboss.org
Sat Jun 2 06:11:00 EDT 2018


    [ https://issues.jboss.org/browse/CDI-709?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13585867#comment-13585867 ] 

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)


More information about the cdi-dev mailing list