• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Navigation problems with primefaces tree

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

i have a problem with navigating from a link in a primefaces tree menu to a specific page. The explanation is the following: I have a template with the following code :

then i have a leftMenu.xhtml with the definition of the left menu :

then i have an index.xhtml where i use the template :

For the TreeNode navigation i have a class TreeMenuBean :

and this is the LinkBean class :

I have a faces-config.xml file with the navigation rules :

i had to put a "*" in the from-view-id tag to be able to navigate to the pages specified with the navigation cases. If i put /templates/leftMenu.xhtml insted of * then the navigation doesn't work and i get the error "WARNING:
JSF1064: Unable to find or serve resource, /deleteDepartment-page.xhtml."

Why is this so ?
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are 2 things in JSF that look almost identical, but refer to 2 very different things.

A URL path. For example, http://https://coderanch.com/forums/posts/reply/0/636227

A Resource path. For example, /templates/other.xhtml

A URL is what the client uses to send a request to the server. A Resource is a "file" (see below) that is part of the WAR used to satisfy the URL request. In the case of a JSF View, the FacesServlet tears down a URL such as http://myhost:8080/mywebapp/templates/other.jsf" and constructs the corresponding template resource path /templates/other.xhtml.

Navigation uses the local URL path, not the resource path. So it would be /templates/other.jsf, assuming you're using the "*.jsf" facelet pattern model.



Note that I said "file". In actuality, a WAR is a single ZIP file and so the resource is just one of the files in the ZIP file, not an actual OS file. That's assuming that your web server doesn't explode the WAR into actual files, which many webapp servers so, either by default or as an option.
 
reply
    Bookmark Topic Watch Topic
  • New Topic