Resource Mapping (again) in RichFaces 4.2.0 Final
josh68 Feb 24, 2012 7:18 PMI'm going to try to keep my posts about this issue to a minimum now that there's a final release and new documentation - thanks!
1) Observation: I tried simply including a /META-INF/resources/static-resource-mappings.properties file in my project to invoke resource mapping. No go. The documentation is pretty light now, so is something actually missing here (like a resource location context-param)? If I add these two context params:
<context-param>
<param-name>org.richfaces.resourceMapping.mappingFile</param-name>
<param-value>/META-INF/richfaces/custom-mapping.properties</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.resourceMapping.location</param-name>
<param-value>#{facesContext.externalContext.requestContextPath}/resources/#{resourceLocation}</param-value>
</context-param>
and then put my mappings in custom-mapping.properties, things work, assuming I include mapping statements like "jquery.js=js/jquery.js" (resolves to my project's folder: "project/resources/js/jquery.js" - good). Not sure what I'm missing in the documentation.
2) However, if I try to map a resource that's not in the root of the RichFaces staticResources folders, within the components-ui.jar (e.g., status.js is within the folder "org.richfaces"), the mapping doesn't seem to work. I've tried mappings like "status.js=local_file.js", "org.richfaces/status.js=local_file.js", and "org.richfaces:\status.js=local_file.js", but no luck with any of the three. Any ideas?
3) Is there any way to map directly to a resource in another library's resources? For instance, I'm trying to map jquery.js to PrimeFaces' jquery.js, but I can't figure out how to do it or if it's possible. If I copy the PF version to my locally mapped resources, of course, I can successfully do it. Just wondering if there's a syntax for doing it directly (from the documentation, it sounds like the left side of the mapping can include a library reference, but maybe the right side can't).
Thanks.