I have a webapp running on Glassfish 3.1.2.2 which uses JSF 2.1 (Mojarra) and PrettyFaces 3.3.3 to facilitate the task of integrating "pretty" REST-style URLs with my application.
However, looking at the generated html code I see rather "ugly" long paths to my application resources. Like this:
<script type="text/javascript" src="/HelloWorld/faces/javax.faces.resource/js/jquery-1.9.1.min.js">
Specifically the faces/javax.faces.resource/
part hurts my eye. Following the main idea of PrettyFaces I'd like to have this part removed.
Is it possible to intercept the generation of these URLs and can PrettyFaces help me with that?
I'm using <h:outputScript name="js/jquery-1.9.1.min.js" />
, <h:outputStylesheet name="css/app.css" />
and <h:graphicImage name="img/logo.png" />
to include resource references in my JSF-Servlet.
edit: I guess I have to do two things?
- One: Map requests like
/img/*
to their actual location/faces/javax.faces.resource/img/*
. - Two: Hook into the URL generation of the
<h:graphicImage />
element (and others).
I would be pleased, if you could give me some pointers on where to start. I'm pretty new to JSF.
Many thanks! :)