ExternalContext.encodeResourceURL() currently serves two purposes:
1. Performs session id-related URL rewriting (HttpServletResponse.encodeURL()
2. Performs portlet-specific URL rewriting
Logging this issue to request that JSF provide a resource encoding API that provides the goodness of portlet-related encoding without the annoyances of requiring the URLs to potentially be session id-encoded at the same time.
(Of course, we'll want the portlet folks to review this to make sure that whatever we do will be acceptable from a portlet/portlet bridge perspective.)