-
1. Re: 2 questions about Seam
denis-karpov Mar 30, 2007 4:53 AM (in response to statelessbean)Second question
@Out @In works with contexts.
@Out
private String hotel;
The @Out annotation declares that an attribute value is outjected to a context variable after method invocations. In this case, the context variable named hotel will be set to the value of the hotel instance variable after every action listener invocation completes. (C)Seam Reference.
The key point for understanding, that injection and outjection occurs on each invocation of an any method of this bean, that was made as action listener invocation. If you just call method from java code there will be no in/outjection.
And also be aware with what contexts you are working. -
2. Re: 2 questions about Seam
waynebagguley Mar 30, 2007 4:59 AM (in response to statelessbean)The variable (e.g. var) will belong (scoped) to the SFSB it is declared in but it will be outjected or injected to/from the relevant context. I don't think you can rely on it being the same object (it might well be) but it should have the same value.
-
3. Re: 2 questions about Seam
fhh Mar 30, 2007 5:02 AM (in response to statelessbean)
The key point for understanding, that injection and outjection occurs on each invocation of an any method of this bean, that was made as action listener invocation. If you just call method from java code there will be no in/outjection.
Is that true? I thought that Seam will intercept any access to a scoped bean but I have never bothered to check.
Regards
Felix -
4. Re: 2 questions about Seam
pmuir Mar 30, 2007 5:05 AM (in response to statelessbean)You need to instantiate the bean using seam (i.e. @In(create=true), or some sort of auto creation), and not just via new Foo()
-
5. Re: 2 questions about Seam
fhh Mar 30, 2007 9:24 AM (in response to statelessbean)That was my understanding. (That's what I meant when I said it had to be scoped).
Thanks!
Felix