Closed ren-zhijun-oracle closed 10 years ago
@javaserverfaces Commented Reported by ova2
@javaserverfaces Commented ova2 said: Someone already commented here https://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-1001 that this mechanism doesn't work with nested folders, but the issue seems to be ignored.
@javaserverfaces Commented @manfredriem said: Can you roll this up in a reproducing example and send it to issues@javaserverfaces.java.net? That would help us a lot. Thanks!
@javaserverfaces Commented ova2 said: Yes, sure Manfred. I will try. The logic in findResource(...) is simple, so that you don't really need an example An JUnit test would be good.
By the way, I think the resourceName in my example should be "mycompany/calendar.xhtml" and the libraryName is "com". This is e.g. how h:graphicImage would resolve it.
@javaserverfaces Commented ova2 said: Hi Manfred,
I sent you (issues@javaserverfaces.java.net) a demo app. Simple deploy it on an JEE7 server and call http://localhost:8080/JAVASERVERFACES-3107-1.0 You will see
javax.faces.view.facelets.FaceletException: com/mycompany/message.xhtml @0,0 <> Cannot create composite component tag handler for composite-source element in taglib.xml file
The exception is raised by com.sun.faces.facelets.tag.AbstractTagLibrary in this case.
I have a composite component webapp/resources/com/mycompany/message.xhtml If you move message.xhtml to webapp/resources/com/message.xhtml and ajust the resource ID in the demo.taglib.xml as
@javaserverfaces Commented @manfredriem said: Thank you for the excellent reproducer, this saved me a lot of time to determine what is happening, unfortunately what you are trying to do is a specification violation. In this particular case your resource-id is invalid.
From the JSF specification you can read
2.6.1.3 Resource Identifiers
@javaserverfaces Commented ova2 said: Hi Manfred. I read the spec. of course, but I thought we can specify nested folders for resources anyway. As I see now, libraryName can not contain path separators. That means com/mycompany/calendar.xhtml is interpreted as libraryName/libraryVersion/resourceName. Right? Or is "mycompany" interpreted as libraryName? Can you clarify please if nested folders are allowed?
@javaserverfaces Commented @manfredriem said: If some code allows you to do that it goes beyond the specification and should be treated as an implementation detail.
@javaserverfaces Commented This issue was imported from java.net JIRA JAVASERVERFACES-3107
@javaserverfaces Commented Marked as works as designed on Friday, December 13th 2013, 7:36:56 am
I'm developing composite and regular components and use the new JSF 2.2 feature which allows to register both in one taglib XML file. I use in my taglib XML the new syntax to register composite components below META-INF/resources. E.g.
The method
in the
is responsible for resource loading by resource ID. But the logic is not correct there. If you have com/mycompany/calendar.xhtml as resource ID (my path to resource under the META-INF/resources folder), the resourceName is extracted as calendar.xhtml (OK), but the libraryName is extracted as mycompany (NOT OK). The libraryName is cut off. It should be com/mycompany. As result, the composite component can not be found ==> Exception.
Environment
JSF 2.2.4
Affected Versions
[2.2.4]