Hi Ed,
Regarding issue 1012 [1], the JSF 2.2 JavaDocs expose a new method on ExternalContext named getApplicationContextPath() which has the following requirements:
* <p class="changed_added_2_2"><em>Servlet:</em>
* Return the result of calling
* <code>getContextPath()</code> on the
* <code>ServletContext</code> instance for this application. It is
* valid to call this method during application startup or shutdown.</p>
Since FacesContext.getCurrentInstance() is a ThreadLocal singleton bound to the request thread, it is not possible to call FacesContext.getCurrentInstance().getExternalContext() during application startup or shutdown.
Also, the Portlet API does not provide access to the underlying ServletContext. I suppose that the best we could do in a portlet environment would be to register a ServletContextListener and remember the ServletContext instance for later reference.
When you get a chance, could you elaborate on what made it necessary to add the getApplicationContextPath() feature?
Thanks,
Neil
[1]
http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-1012