JBoss Developer: Message List - @Factory and @Out: why required=false?Most recent forum messageshttps://developer.jboss.org/community/seam?view=discussionsJive Engage2007-01-08T20:12:29Z2007-01-08T20:12:29ZenRe: @Factory and @Out: why required=false?None None/people/smokingapipedo-not-reply@jboss.com2007-01-08T20:12:29Z2007-01-08T20:12:29Z<!-- [DocumentBodyStart:e5091e2d-f6c7-4a67-894e-3bfd8e789692] --><div class="jive-rendered-content"><p>Hmm, obviously I'm confused. Maybe I was doing something wrong in makeFoo(). I'll try this some more to see what's going on.<br/></p></div><!-- [DocumentBodyEnd:e5091e2d-f6c7-4a67-894e-3bfd8e789692] --><img src='/beacon?t=1521468666237' />2007-01-08T20:12:29Z11 years 2 months ago0Re: @Factory and @Out: why required=false?Gavin King/people/gavin.kingdo-not-reply@jboss.com2007-01-08T17:35:32Z2007-01-08T17:35:32Z<!-- [DocumentBodyStart:6506f696-937e-4758-9e64-af355d647c8d] --><div class="jive-rendered-content"><p>That code will fail if makeFoo() does not initialize foo to a non-null value.</p></div><!-- [DocumentBodyEnd:6506f696-937e-4758-9e64-af355d647c8d] -->2007-01-08T17:35:32Z11 years 2 months ago0Re: @Factory and @Out: why required=false?Norman Richards/people/norman.richardsdo-not-reply@jboss.com2007-01-08T16:36:52Z2007-01-08T16:36:52Z<!-- [DocumentBodyStart:969c8e38-2796-481f-997d-2c421406f341] --><div class="jive-rendered-content"><p>The above looks good to me. Where exactly are you getting the error from? Is makeFoo really setting the foo value?</p></div><!-- [DocumentBodyEnd:969c8e38-2796-481f-997d-2c421406f341] -->2007-01-08T16:36:52Z11 years 2 months ago0@Factory and @Out: why required=false?None None/people/smokingapipedo-not-reply@jboss.com2007-01-08T07:23:13Z2007-01-08T07:23:13Z<!-- [DocumentBodyStart:455d47e9-b9ef-4a9c-b745-cc1b93e18ec9] --><div class="jive-rendered-content"><p>Ok, I'm not understanding something here.<br/><br/>I have a SFSB that with a snippet that looks like this:<br/><br/></p><!--[CodeBlockStart:112a97d4-f0d3-4f7b-a510-707723496326][excluded]--><pre class="java" name="code">
@Out private Foo foo;
@Factory("foo") private void makeFoo() { .... }
</pre><!--[CodeBlockEnd:112a97d4-f0d3-4f7b-a510-707723496326]--><div style="display:none;"></div><br/><br/>and that causes a "foo did not exist but was required" exception when a page is first accessed. This is within a conversation, and this is the first page to be accessed in that conversation. If I put @Out(required=false) then it works as expected. <br/><br/>I don't get this. Foo is required, but shouldn't the factory always create it when it is needed? How can an @Out fail if there is a factory for that component? <br/><br/>I'm still not totally understanding the interplay between @Out and @Factory, and I'm also sometimes getting concurrent access exceptions if I try to do things in both @Begin and @Factory. I know these things all have logic behind them but it hasn't sunk in to me yet. <br/><br/><br/></div><!-- [DocumentBodyEnd:455d47e9-b9ef-4a9c-b745-cc1b93e18ec9] -->2007-01-08T07:23:13Z11 years 2 months ago30