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

  • Home
  • SEARCH
  • 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 6951411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:12:59+00:00 2026-05-27T14:12:59+00:00

<html xmlns=http://www.w3.org/1999/xhtml xmlns:h=http://java.sun.com/jsf/html xmlns:ui=http://java.sun.com/jsf/facelets> <h:body> <title><ui:define name=title>Page 2</ui:define></title> <ui:composition template=template/common/commonLayout.xhtml> <ui:define name=content> This is

  • 0
<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:ui="http://java.sun.com/jsf/facelets">

<h:body>
    <title><ui:define name="title">Page 2</ui:define></title>
    <ui:composition template="template/common/commonLayout.xhtml">
        <ui:define name="content">
            This is the content of Page 2 page<br/>
            <h:form prependId="false">
                <h:commandButton id="goToIndex" value="Go to Index" action="index" />
            </h:form>
            <a href="index.xhtml">Index</a>
        </ui:define>

    </ui:composition>

</h:body>
</html>

I have two identical facelets pages: index.xhtml and page2.xhtml which link to each other. I also have a template file. There is no difference in the code between index and page2, apart from the name of the pages in the title, content text and commandButton values.

When I click on the goToIndex button implemented by the form to navigate to index.xhtml, everything works as expected: it goes to index.xhtml. However, when I click on the link implemented by the [a href] link to navigate to index.xhtml, it goes to index.xhtml but seems to ignore all the template settings for the page, including any form tag. The only thing rendered is the text confined in the “content” definition, but without any css formatting whatsoever.

This thing happens both way round. “index -> page2” and “pag2 -> index”

Any idea why this occurs?

  • 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-27T14:13:00+00:00Added an answer on May 27, 2026 at 2:13 pm

    The page that is called by <a href ...> isn’t processed by the faces servlet and therefore not correctly translated and no css/js included.

    Look in your web.xml and check how the faces servlet is mapped. There you might find something like:

    <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    

    You could change the pattern to:

    <url-pattern>*.xhtml</url-pattern>
    

    Then all files with the xhtml prefix will be processed by the faces servlet. However this could cause problems if in you project the xhtml prefix is used for other purposes than facelets.

    Another way would be to use h:link instead of a:href:

    <h:link value="Index" outcome="index" >
    

    where the outcome attribute takes the target page without .xhtml.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I create a composition template: <ui:composition xmlns=http://www.w3.org/1999/xhtml xmlns:h=http://java.sun.com/jsf/html xmlns:f=http://java.sun.com/jsf/core xmlns:ui=http://java.sun.com/jsf/facelets xmlns:cs=http://java.sun.com/jsf/composite/composite> <h:panelGroup rendered=#{not empty
Here's my page: <html xmlns=http://www.w3.org/1999/xhtml xmlns:h=http://java.sun.com/jsf/html xmlns:cpanel=http://java.sun.com/jsf/composite/components/cpanel xmlns:f=http://java.sun.com/jsf/core xmlns:p=http://primefaces.prime.com.tr/ui xmlns:ui=http://java.sun.com/jsf/facelets> <h:head> <title></title> </h:head> <h:body>
I have this composition : <!DOCTYPE html> <ui:composition xmlns=http://www.w3.org/1999/xhtml xmlns:h=http://java.sun.com/jsf/html xmlns:f=http://java.sun.com/jsf/core xmlns:ui=http://java.sun.com/jsf/facelets> <h:panelGroup rendered=#{empty
What do you call xmlns:p=http://primefaces.org/ui, are they tags? <html xmlns=http://www.w3.org/1999/xhtml xmlns:h=http://java.sun.com/jsf/html xmlns:f=http://java.sun.com/jsf/core xmlns:ui=http://java.sun.com/jsf/facelets xmlns:p=http://primefaces.org/ui>
I have the following template (masterLayout.xhtml): <!DOCTYPE html> <html xmlns=http://www.w3.org/1999/xhtml xmlns:h=http://java.sun.com/jsf/html xmlns:ui=http://java.sun.com/jsf/facelets> <f:view contentType=text/html>
For example: <html xmlns=http://www.w3.org/1999/xhtml xml:lang=en lang=en> <head> <title>title</title> </head> <body> <a href=aaa.asp?id=1> I want
Code: <html xmlns=http://www.w3.org/1999/xhtml> <head> <title>Unusual Array Lengths!</title> <script type=text/javascript> var arrayList = new Array();
I have the following HTML <html xmlns=http://www.w3.org/1999/xhtml > <head runat=server> <title></title> <style> .box {
<!DOCTYPE HTML PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd><html xmlns=http://www.w3.org/1999/xhtml> <head> <title>Test</title> <style type=text/css media=screen>
So I have some XML in the following format: <somenode> <html xmlns=http://www.w3.org/1999/xhtml> <head> <title/>

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.