<div dir="ltr"><div class="gmail_extra">Hi Struberg,</div><div class="gmail_extra"><br></div><div class="gmail_extra">Thanks for your help, I really appreciate it and it is very helpful for me.</div><div class="gmail_extra">
<br></div><div class="gmail_extra">Regards,<br></div><div class="gmail_extra">Muhammad Bhutto</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 20, 2013 at 1:45 PM, Mark Struberg <span dir="ltr"><<a href="mailto:struberg@yahoo.de" target="_blank">struberg@yahoo.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="font-size:8pt;font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif">
.) BeanManager#getReference will return you a 'Contextual Reference', means a normalscoping proxy for the bean. If you have a @SessionScoped User usr; then the Contextual Reference usr will 'point' to the respective User instance (the 'Contextual Instance') of the _current_ session for each invocation. Two different invocations to usr.getName() from 2 different web browsers will give you different answers.<br>
<br>.) Contest#get() will return you the internal 'Contextual Instance' without the normalscoping proxy. This is usually nothing a user should call himself. If you get the User usr for "Karl" that way and store it in an @ApplicationScoped bean or in a static variable, then it will _always_ remain to be the user "Karl" - even for web requests from other
browsers! You will get a direct, non-proxied instance.<br></div></blockquote></div><br><br></div></div>