1
votes

I'm working on a JSF 2.0, Spring 3.1.1 Projekt. I've an old commons-resource-jar created for Spring 3.1.1 MVC with the following structure:

commons.jar
  • --- img
    • --- myLogo.png
  • --- css
    • --- myStyle.css
  • --- js
    • --- myScript.js
      ..

Unfortunately this is not the structure a JSF 2.0 ResourceHandler is handling this correctly. As defined by JSF 2.0 the folder Structure should be

commons.jar
  • --- META-INF
    • --- img
      + --- myLogo.png
    • --- css
      ...

How can I configure my JSF 2.0 ResourceHandler so it can handle my initial folder structure from the old resource-library?

2
I have a custom ResourceResolver, but this is not reacting on img or css files, just on xhtml files. Any Ideas?dog0584
They need to be referenced by <h:outputStylesheet library name>, <h:graphicImage library name>, etc.BalusC

2 Answers

0
votes

get the running application instance and get the resource handler class and modify it may be one way.

javax.faces.application.ResourceHandler

0
votes

If you're using the Facelets technology (which is propably the case with JSF 2.0) you may want to use a custom resource resolver. Check out this answer about how to load resources from outside the default structure.