1 of 1 people found this helpful
You're using suffix mapping rather than prefix mapping I imagine, i.e.
and the FacesServlet confusingly appends the suffix mapping to resources URLs despite the fact that this does
not correspond to the filename.
I imagine you're seeing the facelets development mode error page. You need to find out what's sending the GET
request for jquery.js, presumably it's something in errorPage.xhtml (or a template), do you see a GET for
errorPage.xhmtl in firebug?
One thing that could trigger this behavior is if you used a script tag to load jquery instead of h:outputScript, but
check out what's trying to load jquery first and perhaps post the contents of the errorPage.
I remember having loads of problems with this sort of thing before switching to prefix mapping (which was not a
straightforward exercise involving much changing of css files, filters, resource handlers you name it etc...).
Your reply is very useful. Using the FireBug there's not a GET por errorPage.xhtml but, this page has a template which invoques <h:outputScript name="jquery.js"/>.
And I have
I'll try change the web.xml and discover how avoid this annoying suffix. Thanks.
<h:outputScript name="jquery.js"/> will load the richfaces packaged jquery and I just checked a backup and when I
was using suffix mapping that was all I specified. Is the h:outputScript tag in the h:head section of the template? I also
had this in web.xml:
Presumably the FACELETS_VIEW_MAPPINGS can be a comma separated list (prob described in the Mojarra FAQ).
Using prefix mapping, i.e.
gets rid of the suffix, but does mean that you have a prefix in your URLs which is also a bit annoying. If you front your app server
with Apache you can use mod_rewrite to get rid of it.
I was tried your solutions but the problem persists... Maybe the error is elsewhere. I keep trying.
Find somewhere that jquery.js loads ok, is it using jquery.js.xhtml or jquery.js? what's the difference in the page where it
loads ok, and the one where it doesn't.
I'm not clear which page is loading that results in the error message. In firebug even if a page references a template you
would see the page loading with a GET or POST.
The template is called like this:
My template have the next line
The FireBug shows that the request has been with a GET.
A correct request is like this: http://localhost.../javax.faces.resource/script.js.xhtml
When the page do not generates an error, the query.js.xhtml is loaded correctly