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 7972719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:56:21+00:00 2026-06-04T07:56:21+00:00

I am actually trying to do a web application using JSF, and I have

  • 0

I am actually trying to do a web application using JSF, and I have some issue with the rendering in the web browser.

Here is the context :

I have an index.xhtml page which displays correctly the JSF tags, and I want to navigate to another through a simple hyperlink.

<h:outputLink  value="/Advisor/AddClient.xhtml">
       <h:outputText value="Add a client" />   </h:outputLink>

But then, the AddClient page doesn’t displays the result of the JSF tags as it should.

Here is the addclient file :

<html xmlns="http://www.w3.org/1999/xhtml"      
      xmlns:ui="http://java.sun.com/jsf/facelets" 
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:c="http://java.sun.com/jsp/jstl/core">
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    </head>
    <h:body>
    <ui:composition template="template.xhtml">
        <script type="text/javascript">
            <!-- a validation script used in py page -->
        </script>


        <h:panelGroup layout="block" rendered="#{loginBean.isLogged}">
            <h:form id="formu" onsubmit="return validation()">
                <table>
                    <tr>
                        <td>
                            First name :
                        </td>
                        <td>
                            <h:inputText id="txtFName" value="#{clientCreationBean.fname}"/>                            
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Last name :
                        </td>
                        <td>
                            <h:inputText id="txtLName" value="#{clientCreationBean.lname}"/>                           
                        </td>
                    </tr>
                    <tr>
                        <td>
                            E-Mail :
                        </td>
                        <td>
                            <h:inputText id="txtEmail" value="#{clientCreationBean.email}"/>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Address :
                        </td>
                        <td>
                             <h:inputText id="txtAddress" value="#{clientCreationBean.address}"/>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Zip code :
                        </td>
                        <td>
                            <h:inputText id="txtZip" value="#{clientCreationBean.zip}"/>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            City :
                        </td>
                        <td>
                            <h:inputText id="txtCity" value="#{clientCreationBean.city}"/>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Phone :
                        </td>
                        <td>
                            <h:inputText id="txtPhone" value="#{clientCreationBean.phone}"/>
                        </td>
                    </tr>
                </table>
                <h:commandButton action="#{clientCreationBean.CreateClient()}" value="Ajouter"/>
            </h:form>
          </h:panelGroup>



    </ui:composition>
    </h:body>
</html>

and here is my web.xml :

 <context-param>
        <param-name>javax.faces.PROJECT_STAGE</param-name>
        <param-value>Development</param-value>
    </context-param>
    <context-param>
        <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
        <param-value>.xhtml</param-value>   
    </context-param>

    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <welcome-file-list>
        <welcome-file>faces/index.xhtml</welcome-file>
    </welcome-file-list>

Any idea of why the JSF is not interpreted in my others pages?

UPDATE :

I got AddClient to work like this :

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

Moving AddClient.xhtml to the same folder than Index.xhtml (and not in the “Advisor” folder anymore), and changing my link to :

<h:outputLink  value="AddClient.xhtml">
    <h:outputText value="Ajouter un client" />
 </h:outputLink>

But when I let the page in the Advisor folder with a link poiting at /Advisor/AddClient.xhtml, it doesn’t work. why?

Thanks,

KiTe

  • 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-06-04T07:56:21+00:00Added an answer on June 4, 2026 at 7:56 am

    Your link doesn’t match the faces servlet mapping:

    <h:outputLink  value="/Advisor/AddClient.xhtml">
    

    will not match the pattern:

    /faces/*
    

    That’s why the FacesServlet will not be invoked and your JSF tags are not processed.

    You can either change the link to:

    <h:outputLink  value="/faces/Advisor/AddClient.xhtml">
    

    or better use the .xhtml suffix mapping to in your web.xml:

     <servlet-mapping>
            <servlet-name>Faces Servlet</servlet-name>
            <url-pattern>*.xhtml</url-pattern>
     </servlet-mapping>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Within my web application I am using some custom validation for my form fields.
Am trying to change my web application using AD for authentication. My application uses
I have an issue here a bit complex than I'm trying to resolve since
I am trying to build a simple repository browser into a web application and
I have a problem deploying an Axis 2 web application. I'm using Jboss 4.2.0,
I'm trying to write a scalable custom web server. Here's what I have so
I'm building a web application using Stripes and Spring. It needs to have a
I am actually trying to change the color index for the first word with
I'm actually trying to fix this issue where my projects are always out of
Actually I'm trying to implement an ontouchlistener into my android (1.5) application. therefore i

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.