0

There is a very good article on JSF resource libraries: What is the JSF resource library for and how should it be used?

I'm implementing a simple JSF wrapper for a existing JS library. This library is referencing some images and provide a function setImagePath:

setImagePath("/test/javax.faces.resource/img/");

This is a first step to access the JSF resource library. Obviously I need a suffix like

.jsf?ln=xxx

to access the resource library. Unfortunately the JS library does not provide a setImageSuffix. If I modify the JS library and add this suffix manually to all images it works, but that's not a ideal solution.

Is there any to access my xxx resource library with setImagePath only?

Community
  • 1
  • 1
Thor
  • 6,607
  • 13
  • 62
  • 96

1 Answers1

1

I've had a similar problem. To do so you would have to extend your ResourceHandler to map your resources.

Fortunately, this was done after asking my question and added to OmniFaces. So there is no real need for you to do so again.

By implementing an UnmappedResourceHandler you will then be able to map your resources without the appended suffix.

You will then be able to map your resources(images) in such a fashion :

setImagePath("/test/img/");

Links

Thanks goes to BalusC and OmniFaces

Community
  • 1
  • 1
blo0p3r
  • 6,790
  • 8
  • 49
  • 68