Hello Ed,<div><br></div><div>Couldn't you modify the map to return the constant values for the proper keys? That way, they would be read-only values that don't need to be stored, the Map just needs to know the keys.<br clear="all">
---<br>Kito D. Mann | twitter: kito99 | Author, JSF in Action<br>Virtua, Inc. | <a href="http://www.virtua.com">http://www.virtua.com</a> | JSF/Java EE training and consulting<br><a href="http://www.JSFCentral.com">http://www.JSFCentral.com</a> - JavaServer Faces FAQ, news, and info | twitter: jsfcentral<br>
+1 203-404-4848 x3<br><br>Sign up for the JSFCentral newsletter: <a href="http://oi.vresp.com/?fid=ac048d0e17">http://oi.vresp.com/?fid=ac048d0e17</a><br><br>
<br><br><div class="gmail_quote">On Tue, Aug 10, 2010 at 3:09 PM, Ed Burns <span dir="ltr"><<a href="mailto:edward.burns@oracle.com">edward.burns@oracle.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<a href="https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=868" target="_blank">https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=868</a><br>
<br>
Background:<br>
<br>
The JSF specification contains the following:<br>
<br>
/**<br>
* <p class="changed_added_2_0">The key to which the<br>
* <code>UIComponent</code> currently being processed will be<br>
* associated with within the {@link FacesContext} attributes map.</p><br>
*<br>
* @see javax.faces.context.FacesContext#getAttributes()<br>
*<br>
* @since 2.0<br>
*/<br>
public static final String CURRENT_COMPONENT =<br>
"javax.faces.component.CURRENT_COMPONENT";<br>
<br>
/**<br>
* <p class="changed_added_2_0">The key to which the<br>
* <em>composite</em> <code>UIComponent</code> currently being<br>
* processed will be associated with within the {@link FacesContext}<br>
* attributes map.</p><br>
*<br>
* @see javax.faces.context.FacesContext#getAttributes()<br>
*<br>
* @since 2.0<br>
*/<br>
public static final String CURRENT_COMPOSITE_COMPONENT =<br>
"javax.faces.component.CURRENT_COMPOSITE_COMPONENT";<br>
<br>
The guarantee that the current and current composite components are<br>
available through FacesContext.getAttributes() doesn't seem right for<br>
several reasons:<br>
1) It isn't useful. The static methods<br>
UIComponent.getCurrentComponent() and<br>
UIComponent.getCurrentCompositeComponent() are more convenient and typesafe.<br>
2) It is dangerous. If the values of these attributes is set, the<br>
current stack will be messed up<br>
3) When we aren't using the particular space-inefficient implementation<br>
the JSF RI currently uses, maintaining these attributes just in case a<br>
developer tries to request them is a waste<br>
<br>
Proposal<br>
<br>
Due to our iron-clad commitment to backwards compatibility, we keep the<br>
public static final String constants, but alter the behavior, providing<br>
a context-param to restore the old behavior.<br>
<br>
The constants will only be honored if the context param is set.<br>
<br>
Does this sound ok?<br>
<font color="#888888">--<br>
| <a href="mailto:edburns@oracle.com">edburns@oracle.com</a> | office: +1 407 458 0017<br>
| homepage: | <a href="http://ridingthecrest.com/" target="_blank">http://ridingthecrest.com/</a><br>
| 06 work days until JSF 2.1 Milestone 2<br>
</font></blockquote></div><br></div>