This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I've added Tiles to my facelets application and now my navigation-rules don't work. When I click on any of my links, it just reload the current page. I've tried changing the <from-view-id> from the templated jsf page to the page including the templates and still nothing. I'm including these templates using http://java.sun.com/jsf/facelets:composition and include tags (not both on the same page). Here is a sample template page with links and my faces-conig.xml and parts of the web.xml.
header.xhtml ------------------------------------------- <?xml version="1.0" encoding="utf-8" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
When you break the big rules, you get a lot of little rules.
Joined: May 02, 2007
First, in my faces-config.xml, I have the template header.jsf as my from-view-id, I need to change this to reflect the page in the actual url used to navigate to this page (in this case, my index.xhtml page).
Second, according to my current configuration, in the from-view-id I need to use the .xhtml extension, which is what I'm using for my jsf pages (I can still use the .jsf in the to-view-id though).
Third, in my web.xml I have the filter <filter-mapping> <filter-name>MyFacesExtensionsFilter</filter-name> <url-pattern>/faces/*</url-pattern> </filter-mapping> which is looking in the folder /faces for patterns, not /layout, so I opted to change my folder name to faces and the from-view-id to /faces/index.xhtml.
Fourth, since this header.xhtml will appear on each page and the from-outcome's main and logout are never used elsewhere, I can just set these naviations as global by removing the from-view-id line all together in the faces-config.xml.
Oh, and for all you facelets out there, it's called 'Templating', not Tiles, *noob!*