-
1. Re: Injection problem
alexanderbell May 14, 2009 2:45 PM (in response to alexanderbell)Sorry here's the correct xhtml page (copy/paste failed ;-))
<h:form> Username <h:inputText value="#{user.name}" /> Password <h:inputText value="#{user.password}" /> <h:commandButton actionListener="#{authenticationService.login}" value="Login" /> </h:form>
-
2. Re: Injection problem
nickarls May 14, 2009 9:45 PM (in response to alexanderbell)Hmm. Strange. I don't think it should ever go dependent-scoped, though, since it's defined as request-scoped.
-
3. Re: Injection problem
alexanderbell May 14, 2009 10:01 PM (in response to alexanderbell)It seems that the input text from the gui is set into a dependent-scope User and in the authenticationService I've got a request-scoped User.
I stopped at a breakpoint inlogin
and add a watch expression for the user object. The proxy object inside the user wrote (toString() method) that this is a Proxy for a request scoped User object.So there are two differnt user objects in two different scopes.
The question is why?
Maybe this is a JSF 2.0 issue? -
4. Re: Injection problem
nickarls May 14, 2009 10:52 PM (in response to alexanderbell)Could the EL evaluation produce a temporary dependent scoped object? Might be worth filing a JIRA with the details...
-
5. Re: Injection problem
alexanderbell May 15, 2009 6:33 AM (in response to alexanderbell)But the code is right, isn't it?
Because I don't want to open a jira if it's my fault ;-)Alex
-
6. Re: Injection problem
nickarls May 15, 2009 7:36 AM (in response to alexanderbell)Tried an action instead of an actionListener (not that I think it should matter)?
Go ahead and open a JIRA, at this point it's better to have one bug report too many than one too little. I can't see anything obviously wrong with the code.
-
-
8. Re: Injection problem
gavin.king May 17, 2009 8:18 AM (in response to alexanderbell)Alex, it looks buggish to me. The only thing that seems
funny
in what you've got is the use of actionListener on the button instead of action. Why are you doing it this way? -
9. Re: Injection problem
alexanderbell May 17, 2009 11:34 AM (in response to alexanderbell)Hi Gavin,
I'm using the actionListener instead of action because I don't want to have a return type of String in the authentication Service ;-)
I'm gonna try that example withaction
.BTW I've attached my sample application in the jira bug if you want to give it a try: https://jira.jboss.org/jira/secure/attachment/12326878/source.zip
Alex
-
10. Re: Injection problem
alexanderbell May 18, 2009 12:13 PM (in response to alexanderbell)Hi,
I tried the example with
action
but it also didn't work.
New sample: https://jira.jboss.org/jira/secure/attachment/12326878/source.zipAlex