On Thu, May 7, 2009 at 9:06 AM, Gavin King
<gavin.king@gmail.com> wrote:
Right.
Contextual is there so that frameworks can put stuff in contexts for
"special" cases.
It's not really meant to be used by application code or "normal"
framework code. Stick the stuff in a bean, or use a producer method.
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's extremely common to have to use these attribute maps for one thing or another. It'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:
application scope: FacesContext.getCurrentInstance().getExternalContext().getApplicationMap()
request scope: FacesContext.getCurrentInstance().getExternalContext().getRequestMap()