This content has been marked as final.
Show 5 replies
-
1. Re: Strange Outjection Problems
norman.richards Feb 9, 2007 11:05 AM (in response to toni)What kinds of issues are you seeing?
-
2. Re: Strange Outjection Problems
toni Feb 9, 2007 11:31 AM (in response to toni)To reproduce the error I wrote the following:
Bean@Name("test") public class Test implements Serializable { String text; public String getText() { return text; } public void setText(String text) { this.text = text; } public String toString() { return text; } }
SFSB@Stateful @Name("testOutjection") public class TestOutjection implements BasicTestOutjection { @In(create = true) EntityManager entityManager; @Out(required = false) Test test; @Begin(join = true) public String outject() { test = new Test(); test.setText("outject"); return "test"; } public String inject() { test.setText("inject"); return "test"; } @Destroy @Remove public void destroy() { } }
JSF view<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> <%@ taglib uri="http://jboss.com/products/seam/taglib" prefix="s" %> <f:view> <h:panelGrid> <h:form> <s:validateAll> <h:commandButton type="submit" value="Outject" action="#{testOutjection.outject}"/> <h:commandButton type="submit" value="Inject" action="#{testOutjection.outject}"/> </s:validateAll> </h:form> <h:messages/> </h:panelGrid> </f:view>
I used the seam.debug page to look at the conversation. The Test Bean never shows up.
I finally figured out why. Adding the following line to the @Out annotation will make it appear.
scope = ScopeType.CONVERSATION
Is that correct? Nowhere in my code I have been using this line, but I need it now. I think that it used to work well without it.
Arent seam components outjected into the default scop of the component from where they are outjected from? And isn't the default scope CONVERSATION for SFSB?
If somebody can maybe briefly explain this and if it has changed between releases? -
3. Re: Strange Outjection Problems
toni Feb 10, 2007 6:09 AM (in response to toni)Hi Norman,
I'm still having those problems. Now I added the scope CONVERSATION to all the @Out tags, and I get other weired stuff.
Could you please comment on this? -
4. Re: Strange Outjection Problems
toni Feb 10, 2007 6:13 AM (in response to toni)I also completely installed JBoss 4.0.5 GA with Seam 1.1.6 from scratch, because I did not use the BETA installer before. But it does not help.
-
5. Re: Strange Outjection Problems
hstang Feb 10, 2007 10:43 AM (in response to toni)"toni" wrote:
Arent seam components outjected into the default scop of the component from where they are outjected from?
No. The default scope of the Test component is used. Since Test is a java-bean, and the default scope of a java-bean is Event, the component will be outjected to the Event context."toni" wrote:
And isn't the default scope CONVERSATION for SFSB?
Yes, but it's not using the default scope of SFSB here.