New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ResourceUtils: does not recognize resource URLs on Jakarta EE #9452
Comments
Thanks for the excellent report! |
shouldnt RESOURCE_IDENTIFIER be shaded to jakarta? |
really weird
maybe someone else can debug further |
I decompiled the jakarta jar, this is the method: public static String getResourceURL(final FacesContext context, final String value) {
if (LangUtils.isBlank(value)) {
return "";
}
if (value.contains("/javax.faces.resource")) {
return value;
}
final String url = context.getApplication().getViewHandler().getResourceURL(context, value);
return context.getExternalContext().encodeResourceURL(url);
} Seems like the compiler, knowing that |
puuuh, okay |
Nice fix! |
Describe the bug
org.primefaces.util.ResourceUtils.getResourceURL(FacesContext, String)
doesn't recognize resource URLs on Jakarta EE. This caueses the ImageCropper to break when resource are used, i.e.#{resource['requestPhotosEdit:9752-66110-07_3']}
used in theimage
attribute.These URLs resolve into something like
/admin-ui/jakarta.faces.resource/9752-66110-07_3.jsf?ln=requestPhotosEdit
. But in the rendered HTML code they become something like/admin-ui//admin-ui/jakarta.faces.resource/9752-66110-07_3.jsf?ln=requestPhotosEdit
(the context path gets prepended another time).I hunted this down to
org.primefaces.util.ResourceUtils.getResourceURL(FacesContext, String)
:In the case of a resource URL, the value should be returned unmodified. Instead, the
else
branch is taken (I guess):To me it seems that it simply does not recognize that this is a resource URL because it's still stuck in the
javax
namespace (despiteResourceHandler.RESOURCE_IDENTIFIER
actually having the correct value).Reproducer
I have forked the
jakarta
branch of the primefaces-test project:https://github.com/andrejkolontai/primefaces-test/tree/jakarta
To reproduce, clone my repo, check out the
jakarta
branch and runOpen http://localhost:8080/primefaces-test/ in some browser.
You will see:
jakarta
namespace)javax
namespacejakarta
URL afterResourceUtils.getResourceURL
which is modifiedjavax
URL afterResourceUtils.getResourceURL
(which is not modified, but I don't really care it's just to prove that the old namespace is still beeing used).Expected behavior
jakarta
resource URL should be returned unmodified.PrimeFaces edition
Community
PrimeFaces version
12.0.0
Theme
No response
JSF implementation
Mojarra
JSF version
4.0
Java version
11
Browser(s)
Chrome(ium)
The text was updated successfully, but these errors were encountered: