[jbosstools-issues] [JBoss JIRA] (JBIDE-26029) Incorrect warning for @Inject ServletContext

Jeff MAURY (JIRA) issues at jboss.org
Wed Jun 20 02:37:00 EDT 2018


     [ https://issues.jboss.org/browse/JBIDE-26029?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jeff MAURY updated JBIDE-26029:
-------------------------------
    Fix Version/s: 4.6.0.AM3
                       (was: 4.6.x)


> Incorrect warning for @Inject ServletContext
> --------------------------------------------
>
>                 Key: JBIDE-26029
>                 URL: https://issues.jboss.org/browse/JBIDE-26029
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: cdi
>    Affects Versions: 4.5.3.Final
>            Reporter: Rich DiCroce
>            Assignee: Jeff MAURY
>             Fix For: 4.6.0.AM3
>
>
> If you inject ServletContext into a CDI bean, it gets flagged with this warning:
> {quote}
> No bean is eligible for injection to the injection point [JSR-346 §5.2.2]
> {quote}
> This warning appears to be correct for CDI 1.0, but not for later versions. From CDI 2.0 spec section 18.8 (also CDI 1.1/1.2 section 3.8):
> {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,
> {quote}



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)



More information about the jbosstools-issues mailing list