Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6787887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:25:10+00:00 2026-05-26T17:25:10+00:00

I’m having some trouble with navigation when using Facelets. I have my master template

  • 0

I’m having some trouble with navigation when using Facelets.

I have my master template in /WEB-INF:

<h:body>
    <div id="container">
        <div id="header">
            <ui:insert name="header">Header</ui:insert>
        </div>

        <div id="navigation">

            <a href="ram.xhtml">RAM</a>
            <a href="mobo.xhtml">Motherboard</a>
            <a href="video.xhtml">Video Card</a>
        </div>

        <div id="content">
            <ui:insert name ="content"></ui:insert>
        </div>

    </div>
</h:body> 

and then 2 template clients that look exactly the same, index.xhtml and ram.xhtml:

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./WEB-INF/layoutTemplate.xhtml">

    <ui:define name="header">
       some text
    </ui:define>

    <ui:define name="content"> 
        some content
    </ui:define>


</ui:composition>

If either of these pages are set as the welcome page in the web.xml, they are rendered correctly, with CSS and everything. But if I try to navigate from one page to the other using the link I get

This XML file does not appear to have any style information associated with it. The document tree is shown below.

Any hints would be greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T17:25:10+00:00Added an answer on May 26, 2026 at 5:25 pm

    This means that the request URL (as appears in browser address bar) didn’t match the URL pattern of the FacesServlet as definied in web.xml.

    Those links

    <a href="ram.xhtml">RAM</a>
    <a href="mobo.xhtml">Motherboard</a>
    <a href="video.xhtml">Video Card</a>
    

    expects the FacesServlet to be mapped on *.xhtml. But if it’s mapped on for example *.jsf and changing it to *.xhtml is not an option for some reason (I however strongly recommend it), then you’d need to fix the links

    <a href="ram.jsf">RAM</a>
    <a href="mobo.jsf">Motherboard</a>
    <a href="video.jsf">Video Card</a>
    

    Or, better, just use <h:link>. It’ll implicitly append the proper context path and FacesServlet mapping:

    <h:link value="RAM" outcome="ram" />
    <h:link value="Motherboard" outcome="mobo" />
    <h:link value="Video Card" outcome="video" />
    

    See also:

    • Communication in JSF 2.0 – Implicit navigation
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
We're building an app, our first using Rails 3, and we're having to build
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I have thousands of HTML files to process using Groovy/Java and I need to
I have some data like this: 1 2 3 4 5 9 2 6
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.