<div dir="ltr">Hi all,<div><br></div><div>I was reading the CDI 1.2 spec and couldn&#39;t clearly find the way serialization and scopes work. The only explicit sentence I found was : </div><div><br></div><div><br></div><div><div><i>1.3.1. JSF example</i></div><div><i>The @SessionScoped annotation defined in Section 2.4.1, “Built-in scope types” is a scope<br></i></div><div><i>type that specifies the lifecycle of instances of Login. <b>Managed beans with this scope must be</b></i></div><div><i><b>serializable.</b></i></div><div><br></div><div><br></div><div>The Weld documentation is a bit more explicit : </div><div><br></div><div><div><i>5.2. Built-in scopes</i></div><div><i><b>Managed beans with scope @SessionScoped or @ConversationScoped must be serializable</b>, since the container passivates the HTTP session from time to time.</i></div></div><div><br></div><div><br></div><div>And in the Java EE Tutorial we find (<a href="http://docs.oracle.com/javaee/6/tutorial/doc/gjbbk.html">http://docs.oracle.com/javaee/6/tutorial/doc/gjbbk.html</a>) : </div><div><br></div><div><span style="font-family:Arial,Helvetica,FreeSans,Luxi-sans,&#39;Nimbus Sans L&#39;,sans-serif;font-size:12px"><b><font color="#000000">Beans that use session, </font><font color="#ff0000">application</font><font color="#000000">, or conversation scope must be serializable</font></b><font color="#000000">, but beans that use request scope do not have to be serializable.</font></span><br></div><div><span style="color:rgb(0,0,0);font-family:Arial,Helvetica,FreeSans,Luxi-sans,&#39;Nimbus Sans L&#39;,sans-serif;font-size:12px"><br></span></div><div><span style="color:rgb(0,0,0);font-family:Arial,Helvetica,FreeSans,Luxi-sans,&#39;Nimbus Sans L&#39;,sans-serif;font-size:12px"><br></span></div><div><span style="color:rgb(0,0,0);font-family:Arial,Helvetica,FreeSans,Luxi-sans,&#39;Nimbus Sans L&#39;,sans-serif;font-size:12px">This even made be doubt about the application scope ?!?</span></div><div><span style="color:rgb(0,0,0);font-family:Arial,Helvetica,FreeSans,Luxi-sans,&#39;Nimbus Sans L&#39;,sans-serif;font-size:12px"><br></span></div><div><span style="color:rgb(0,0,0);font-family:Arial,Helvetica,FreeSans,Luxi-sans,&#39;Nimbus Sans L&#39;,sans-serif;font-size:12px"><br></span></div><div><span style="color:rgb(0,0,0);font-family:Arial,Helvetica,FreeSans,Luxi-sans,&#39;Nimbus Sans L&#39;,sans-serif;font-size:12px">Any way, could we clarify this in the CDI spec ?</span></div><div><span style="color:rgb(0,0,0);font-family:Arial,Helvetica,FreeSans,Luxi-sans,&#39;Nimbus Sans L&#39;,sans-serif;font-size:12px"><br></span></div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Antonio Goncalves <br>Software architect, Java Champion and Pluralsight author<br><br><a href="http://www.antoniogoncalves.org" target="_blank">Web site</a> | <a href="http://twitter.com/agoncal" target="_blank">Twitter</a> | <a href="http://www.linkedin.com/in/agoncal" target="_blank">LinkedIn</a> | <a href="http://pluralsight.com/training/Authors/Details/antonio-goncalves" target="_blank">Pluralsight</a> | <a href="http://www.parisjug.org" target="_blank">Paris JUG</a> | <a href="http://www.devoxx.fr" target="_blank">Devoxx France</a></div></div>
</div></div>