• Post Reply Bookmark Topic Watch Topic
  • New Topic

Resource reference error

 
Burferd Grabarkowitz
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using JSF 2, Facelets, NetBeans 7.0, Glassfish 3.2, Mojarra 2.1.0

I get the folllowing Warnings in my server log when changing pages or referencing resources.

Navigation:
WARNING: JSF1015: Request path '/faces/faces/EnrollPage.xhtml' begins with one or more occurrences of the FacesServlet prefix path mapping '/faces'.
I am doing navigation through redirect with the following method:

I've tried leaving off the "faces/" prefix like the warning suggests, but when I do that, I cannot navigate.
I leave on the prefix and it navigates, but I get the warning message.

Web page resources:
WARNING: JSF1015: Request path '/faces/faces/resources/css/common.css' begins with one or more occurrences of the FacesServlet prefix path mapping '/faces'.
WARNING: JSF1015: Request path '/faces/faces/resources/scripts/calendar-setup.js' begins with one or more occurrences of the FacesServlet prefix path mapping '/faces'.

Here is how I refernce the resources in the <head> section of the page xhtml code:


Css file resources:
WARNING: JSF1015: Request path '/faces/faces/resources/Images/backgroundPage.jpg' begins with one or more occurrences of the FacesServlet prefix path mapping '/faces'.
Here is how I refernce the image resources in the css file:

My directory structure is:
Web Pages -> resources ->Images

I am at a loss to understand how to get rid of the warning messages.
I have tried several different permutations of the reference addresses, but nothing else I have tried works.

Any suggestions?

Thanks.
 
Stefan Evans
Bartender
Posts: 1822
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well the reason is that you are redirecting using the servlet engine, rather than using the JSF navigation functionality.
Is the whole "redirect to random page" functionality required?
Can you not express this functionality using the JSF navigation rules?

 
Burferd Grabarkowitz
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the feedback.

I need to do the redirect from within a backing bean, because there are sometimes conditions that I need to check to determine the page.
I could probably get around this in most cases, but I am trying to migrate a fairly large application from JSF 1.2 where this behavior was acceptable and was trying to lessen the migration pains.
When you mention "JSF Navigation rules" are you referring to navigation coded in the page itself (action="newpage.xhtml")?
Or do you mean JSF 1.2 navigation rules in an xml file?
I am trying to get away from the xml file becsuse it ended up being over 5000 lines for this application (so far) and I really want to avoid propigating that.
Most pages have conditions that need to be met before I can allow navigation away from that page.

This might be an answer to most of the navigation issues, however how do I get around warnings for the other references to thinds like css files and javascript files that are referenced in the web page and the images that are referenced in the css files?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!