<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>FYI, I tried this and bad things started to happen:</div><div><br></div><div>public class MyResourceImpl extends javax.faces.application.ResourceWrapper {</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>@Override</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>public String getRequestPath() {</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>ExternalContext externalContext = FacesContext.getCurrentInstance.getExternalContext();</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>return externalContext.encodeResourceURL(getWrapped().getRequestPath());</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div><div>}</div><div><br></div><div>So at this point I would say three things:</div><div><br></div><div>1. Mojarra's implementation of ResourceImpl.getRequestPath() is fine -- don't change it. Portlet bridges can work with the return value -- they just have to parse out the request parameters and make them work with a javax.portlet.ResourceURL</div><div><br></div><div>2. The Javadocs for Resource.getRequestPath() [1] should be fortified to explicitly say that this method should:</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>A. Construct a String-based URI that includes the ResourceHandler.RESOURCE_IDENTIFIER (aka "javax.faces.resource")</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>B. Add request parameters to the URL for:</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>i. Resource Name</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>ii. Library Name</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>iii. Library Version</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>iv. Locale Prefix</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>C. Call ViewHander.getResourceURL(uri) to obtain a URL and return that value</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>D. It is the responsibility of the caller to call ExternalContext.encodeResourceURL(String) on the return value before rendering the URL in the response</div><div><br></div><div>3. Since the following classes in Mojarra call Resource.getRequestPath(), they should get fixed so that they call ExternalContext.encodeResourceURL(String):</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>com.sun.faces.el.ResourceELResolver</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>com.sun.faces.renderkit.html_basic.ScriptRenderer</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>com.sun.faces.renderkit.html_basic.StylesheetRenderer</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>com.sun.faces.renderkit.RenderKitUtils</div><div><br></div><div>Anyone from the Mojarra team agree/disagree?</div><div><br></div><div>Thanks,</div><div><br></div><div>Neil</div><div><br></div><div>[1] <a href="https://javaserverfaces.dev.java.net/nonav/docs/2.0/javadocs/javax/faces/application/ResourceWrapper.html#getRequestPath">https://javaserverfaces.dev.java.net/nonav/docs/2.0/javadocs/javax/faces/application/ResourceWrapper.html#getRequestPath</a>()</div><div><br></div><div><br></div><blockquote type="cite"><div>On Jan 13, 2010, at 1:07 PM, Lincoln Baxter, III wrote:</div><blockquote type="cite"><p></p></blockquote></blockquote><blockquote type="cite"><p>Sorry. Hard to type on the phone. I was speaking specifically about externalcontext.getrequestpath()</p><p>The resource.getrequestpath() method states no such requirement. It may be an oversight.</p><p>Lincoln Baxter III<br><a href="http://ocpsoft.com/">http://ocpsoft.com</a><br><a href="http://scrumshark.com/">http://scrumshark.com</a><br>Keep it simple.</p></blockquote><div><br></div><div><div>On Jan 13, 2010, at 12:50 PM, Neil Griffin wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Thanks Lincoln. Well if that's indeed the case, then I guess that means there are some bugs in Mojarra. For example, StyleSheetRenderer.encodeEnd(FacesContext, UIComponent) should call ExternalContext.encodeResourceURL() before it outputs the <link> tag.<div><br></div><div>Anyone from the Mojarra team agree/disagree?</div><div><br></div><div>Neil<br><div><br></div><div><div><div>On Jan 13, 2010, at 12:43 PM, Lincoln Baxter, III wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><p>I believe it is your responsibility, since that method is required to simply pass-through the servlet/portletrequest return value for that method.</p><p>Lincoln Baxter III<br>
<a href="http://ocpsoft.com/">http://ocpsoft.com</a><br>
<a href="http://scrumshark.com/">http://scrumshark.com</a><br>
Keep it simple.</p><div><br class="webkit-block-placeholder"></div><blockquote type="cite">On Jan 13, 2010 12:18 PM, "Neil Griffin" <<a href="mailto:neil.griffin@portletfaces.org">neil.griffin@portletfaces.org</a>> wrote:<br><br>Hello all,<br>
<br>
This could be a bug in Mojarra 2.0.2, or it could be a problem with the spec -- I'm not sure. Someone please help me out. :-)<br>
<br>
I'm trying to get JSF 2.0 resource stuff to work right in the PortletFaces Bridge, but the return value from Resource.getRequestPath() is not encoded...<br>
<br>
So the question is... who's responsibility is it to call ExternalContext.encodeResourceURL()? Should that already be done by Resource.getRequestPath(), or should the calling method (like StyleSheetRenderer.encodeEnd(FacesContext, UIComponent) take care of it?<br>
<br>
Thanks,<br>
<font color="#888888"><br>
Neil<br>
<br>
<br>
<br>
</font></blockquote><div><br class="webkit-block-placeholder"></div>
</blockquote></div><br></div></div></div></blockquote></div><br></div></body></html>