-
1. Re: @Inject in @FacesComponent
tremes Aug 4, 2015 2:05 AM (in response to ulkgun)Hi,
In which component do you have injection? Do you have some example? I guess it should work. Where do you find that it should not be injected?
-
2. Re: @Inject in @FacesComponent
ulkgun Aug 4, 2015 7:56 AM (in response to tremes)I have a custom jsf tag (endeksSec.xhtml):
<ui:composition ...>
<cc:interface componentType="com.infina.ops.jsf.tags.comp.dt.EndeksSecTag">
Component class is a faces component:
@FacesComponent("com.infina.ops.jsf.tags.comp.dt.EndeksSecTag")
public class EndeksSecTag extends UINamingContainer {
@Inject private EndeksServisi es;//<<which is null in 9.0 but OK in 8.2
}
-
3. Re: @Inject in @FacesComponent
tremes Aug 4, 2015 8:47 AM (in response to ulkgun)Can you please share or provide some reproducer archive?
-
4. Re: @Inject in @FacesComponent
ulkgun Aug 4, 2015 4:11 PM (in response to tremes)Here is the InjectTest.war - Google Drive
For your previous qustion here is where I found this should not be working : http://jdevelopment.nl/jsf-22/#injection
Unfortunately the ones that perhaps matter most of all, converters & validators, are still not injection targets.
Thank you
-
5. Re: @Inject in @FacesComponent
tremes Aug 5, 2015 4:39 AM (in response to ulkgun)I think it's Mojarra bug. I created [WFLY-5057] Could not resolve injected property in custom @FacesComponent - JBoss Issue Tracker. Yes but in your case it's not validator nor converter if I am not mistaken.
-
6. Re: @Inject in @FacesComponent
tremes Aug 7, 2015 1:28 AM (in response to tremes)Hm the bug was closed as won't fix. It's a bit weird to me but looks like it really worked by accident. You can see comment from Manfred on https://java.net/jira/browse/JAVASERVERFACES-4006
-
7. Re: @Inject in @FacesComponent
ulkgun Aug 10, 2015 5:32 PM (in response to tremes)Yes it is a bit unfortunate. It seems we won't upgrade to WF9/WF10 until JSF 2.3 arrives. For workaround, if someone else needs, a utility method with signature public static T getTyped(Class clazz) can be written into the getter to lookup CDI beans. Thank you Tomas for concern I will mark your answer correct.