[richfaces-issues] [JBoss JIRA] Commented: (RF-10560) icon attribute does not support JSF 2.0 'resource' implicit object
Nick Belaevski (JIRA)
jira-events at lists.jboss.org
Fri Feb 18 08:10:14 EST 2011
[ https://issues.jboss.org/browse/RF-10560?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12583259#comment-12583259 ]
Nick Belaevski commented on RF-10560:
-------------------------------------
Martin,
IMO, this is a bug in Mojarra, because ViewHandlerImpl did the necessary check:
{noformat}
public String getResourceURL(FacesContext context, String path) {
ExternalContext extContext = context.getExternalContext();
if (path.charAt(0) == '/' && !path.startsWith(extContext.getRequestContextPath())) {
return (extContext.getRequestContextPath() + path);
} else {
return path;
}
}
{noformat}
while MultiViewHandler does the blind concatenation:
{noformat}
public String getResourceURL(FacesContext context, String path) {
ExternalContext extContext = context.getExternalContext();
if (path.charAt(0) == '/') {
return (extContext.getRequestContextPath() + path);
} else {
return path;
}
}
{noformat}.
I've looked at how MyFaces does this, but I have to admit that RichFaces dynamic resources do not use ResourceHandler.RESOURCE_IDENTIFIER to identify resource requests.
> icon attribute does not support JSF 2.0 'resource' implicit object
> ------------------------------------------------------------------
>
> Key: RF-10560
> URL: https://issues.jboss.org/browse/RF-10560
> Project: RichFaces
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: compatibility, core
> Affects Versions: 4.0.0.Milestone6
> Environment: richfaces 4 trunk
> Reporter: Martin Kočí
> Assignee: Nick Belaevski
> Fix For: 4.0.0.CR1
>
>
> for example:
> r:menuItem icon="#{resource['images:user.gif']}"
> rendered HTML will contain src=/webAppRoot/webAppRoot/faces/javax.faces.resource/user.gif?ln=images" - the context root is renderer twice.
> Reason: RenderKitUtils.getResourceURL(String, FacesContext) appends the extra prefix.
> Right now I have no time for patch but I did it already twice: for myfaces and trinidad
> https://issues.apache.org/jira/browse/MYFACES-2531
> https://issues.apache.org/jira/browse/TRINIDAD-1638
> Feel free to copy it - important methods are:
> org.apache.myfaces.shared.renderkit.RendererUtils.getIconSrc(FacesContext, UIComponent, String)
> org.apache.myfaces.shared.renderkit.RendererUtils.toResourceUri(FacesContext, Object)
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the richfaces-issues
mailing list