As far as I remember, conversation contexts are not available in servlet filters (at least in seam version 2.x). Because conversation definition is currently tied to JSF lifecycle, the best approach from my experience is avoid servlet filter (and others) and only use JSF extension points like phase listeners.<br>
<br>br, Sven<br><br><br><div class="gmail_quote">2010/4/9 Mark Struberg <span dir="ltr"><<a href="mailto:struberg@yahoo.de">struberg@yahoo.de</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Sorry, I don't really get it.<br>
<br>
If you have a 'transient conversation' and you like to send an event to BeanX and there is no contextual instance of that BeanX already in your transient conversation context, then a new one will get created and the event will get received by this contextual instance.<br>
<br>
However, a few nanoseconds later the restoreView phase will restore the ViewRoot and we find a cid=4711 there. So we will now lookup this context with cid=4711 and oops, this already contains a contextual instance of BeanX which DIDN'T get the event!<br>
<br>
So what is the transient conversation really doing? What is it for?<br>
<br>
Sometimes a context may return isActive() == false and this has a very good reason! Doing any trickery in such cases will imo cause more problems than they solve.<br>
<br>
LieGrue,<br>
strub<br>
<br>
--- Pete Muir <<a href="mailto:pmuir@redhat.com">pmuir@redhat.com</a>> schrieb am Fr, 9.4.2010:<br>
<br>
> Von: Pete Muir <<a href="mailto:pmuir@redhat.com">pmuir@redhat.com</a>><br>
> Betreff: Re: [weld-dev] proper handling of Events for beans in inactive Contexts?<br>
> An: "Mark Struberg" <<a href="mailto:struberg@yahoo.de">struberg@yahoo.de</a>><br>
> CC: <a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a><br>
> Datum: Freitag, 9. April, 2010 11:37 Uhr<br>
<div><div></div><div class="h5">> Tricky situation, and something we<br>
> "fixed" in Seam by having a transient conversation always<br>
> active. I have a feeling that is what CDI should do to.<br>
><br>
> On 25 Mar 2010, at 16:49, Mark Struberg wrote:<br>
><br>
> > Hi!<br>
> ><br>
> > I have the following scenario:<br>
> ><br>
> > *) A ServletFilter fires a UserLoggedInEvent<br>
> > *) A @ConversationScoped MyBean @Observes<br>
> UserLoggedInEvent with Reception.ALWAYS<br>
> ><br>
> > The problem here is that the Conversation is not yet<br>
> 'opened' at the time the ServletFilter fires that event.<br>
> Thus ConversationContext.isActive() == false and I cannot<br>
> create this bean.<br>
> ><br>
> > A similar situation appears if you try to send an<br>
> event to a @ViewScoped bean from a JSF phase where the<br>
> ViewMap doesn't yet exist.<br>
> ><br>
> > So since there is no way to create a contextual<br>
> instance, the obvious solution is to not send the<br>
> notification to this very bean.<br>
> ><br>
> > I didn't find this covered in the spec and I don't yet<br>
> see much we can do in this case. This may cause some not so<br>
> obvious behaviour and user may wonder why they don't get the<br>
> event.<br>
> ><br>
> > So, should we log some info in this case or silently<br>
> swallow it?<br>
> ><br>
> ><br>
> > txs and LieGrue,<br>
> > strub<br>
> ><br>
> ><br>
> > __________________________________________________<br>
> > Do You Yahoo!?<br>
> > Sie sind Spam leid? Yahoo! Mail verfügt über einen<br>
> herausragenden Schutz gegen Massenmails.<br>
> > <a href="http://mail.yahoo.com" target="_blank">http://mail.yahoo.com</a><br>
> ><br>
> > _______________________________________________<br>
> > weld-dev mailing list<br>
> > <a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a><br>
> > <a href="https://lists.jboss.org/mailman/listinfo/weld-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/weld-dev</a><br>
><br>
><br>
<br>
__________________________________________________<br>
Do You Yahoo!?<br>
Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails.<br>
<a href="http://mail.yahoo.com" target="_blank">http://mail.yahoo.com</a><br>
<br>
_______________________________________________<br>
weld-dev mailing list<br>
<a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/weld-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/weld-dev</a><br>
</div></div></blockquote></div><br>