<div class="gmail_quote">On Thu, May 7, 2009 at 9:06 AM, Gavin King <span dir="ltr">&lt;<a href="mailto:gavin.king@gmail.com">gavin.king@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Right.<br>
<br>
Contextual is there so that frameworks can put stuff in contexts for<br>
&quot;special&quot; cases.<br>
<br>
It&#39;s not really meant to be used by application code or &quot;normal&quot;<br>
framework code. Stick the stuff in a bean, or use a producer method.</blockquote><div><br>So the question was also brought up whether we should provide the unified API to the standard attribute maps in the Servlet and JSF APIs. Ideally, of course, you are using beans and producer methods to populate these contexts. But one of the major usability improvements provided by Seam was the fact that you had one way to access all contexts. Given that we have all been involved in writing applications for companies, you should know as well as I do that it&#39;s extremely common to have to use these attribute maps for one thing or another. It&#39;s life. Clint said in the meeting you can always just get a handle to that map the regular way. Let me remind you how this is done in JSF:<br>
<br>application scope: FacesContext.getCurrentInstance().getExternalContext().getApplicationMap()<br></div></div>request scope: FacesContext.getCurrentInstance().getExternalContext().getRequestMap()<br>session scope: FacesContext.getCurrentInstance().getExternalContext().getSessionMap()<br>
view scope: FacesContext.getCurrentInstance().getViewRoot().getViewMap()<br>flash scope: very bizarre mix of request map and some internal state<br><br>All I&#39;m saying is that I think Seam should provide producers that expose these maps so that they are injectable (as the type AttributeMap). I&#39;m not saying we use these maps to manipulate or access beans. This is for integration with legacy systems, storing data ad-hoc in a non-JSR-299 way, or whatever else the case may be. The question is going to come up and I think people will just look for solutions elsewhere (<a href="http://sourceforge.net">sourceforge.net</a>) to patch Seam to provide something like this. It&#39;s not perfect. It&#39;s life.<br>
<br>-Dan<br><br>-- <br>Dan Allen<br>Senior Software Engineer, Red Hat | Author of Seam in Action<br><br><a href="http://mojavelinux.com">http://mojavelinux.com</a><br><a href="http://mojavelinux.com/seaminaction">http://mojavelinux.com/seaminaction</a><br>
<a href="http://in.relation.to/Bloggers/Dan">http://in.relation.to/Bloggers/Dan</a><br><br>NOTE: While I make a strong effort to keep up with my email on a daily<br>basis, personal or other work matters can sometimes keep me away<br>
from my email. If you contact me, but don&#39;t hear back for more than a week,<br>it is very likely that I am excessively backlogged or the message was<br>caught in the spam filters.  Please don&#39;t hesitate to resend a message if<br>
you feel that it did not reach my attention.<br>