-
1. Re: Weird behaviour with outjection
pmuir Feb 26, 2007 8:28 PM (in response to rlhr)is testAction.view called on page load? If so is user set in the method?
-
2. Re: Weird behaviour with outjection
rlhr Feb 27, 2007 3:55 AM (in response to rlhr)It is called by clicking a link (<h:outputLink /> that call the page /home.xhtml.
So I checked that the view method is properly called and the id of the user is properly passed, the user retrieved and set.
The interesting thing is that I added a getTest() method to the SFSB that just return a string.
If I call #{testAction.test} in the page, any further occurence of #{user.xxx} will work in the page. But any previous accurence will render nothing.
So it seems that the user bean is not outjected until the page is rendered and an explicit call to a method of the SFSB is done in that particular case.
I try to investigate to find out if there is anything different about what I do that leads to this strange behaviour. -
3. Re: Weird behaviour with outjection
rlhr Mar 6, 2007 4:43 PM (in response to rlhr)So I'm finally back to this issue and narrowed down the problem.
I have 2 SFSB named testAction (defined in previous post) and anotherAction that actually outject the User bean.
The scope of both SFSB is conversation and the outjection on both SFSB is defined as:@Out(required=true) private User user = null;
In anotherAction SFSB, the outjection works fine. In the other one, the outjection is not done unless the xhtml file contains something like #{testAction.user.xxx}.
Now if in the testAction is change the code as follow:@Out(required=true) private User user2 = null;
And consequently use in my xhtml file #{user2.xxx}, everything is fine.
This change works too:@Out(value="user2", required=true) private User user = null;
So it looks like the problem comes from the fact that the 2 user bean are outjected under the same name.
Since they are outjected in different conversations, why is this a problem?
Is this a bug or is it not possible to outject bean under the same name?
Thanks,
Richard