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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:53:46+00:00 2026-06-17T19:53:46+00:00

I have a problem with loading Facelets pages from Javascript. I’m working with Netbeans

  • 0

I have a problem with loading Facelets pages from Javascript. I’m working with Netbeans 7.2, Glassfish 3.1.2 and Java EE 6.

I made a simple test page:

<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:h="http://java.sun.com/jsf/html">
<h:head>
    <script type="text/javascript">
        window.location.href = "index.xhtml";
    </script>
    <title>winq match!</title>
</h:head>
<h:body>
    <h1>WING MATCH!!</h1>
    <h:form>
        <h:commandButton id="Next" value="weiter" action="index"/> 
    </h:form>
</h:body>

The index.xhtml page that should be loaded with window.location.href is:

<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:f="http://java.sun.com/jsf/core">
<h:head>
    <title>Facelet Title</title>
</h:head>
<h:body>
    <h:form>
        <h:outputText value="TestTestTestTestTest"/>
        msg <h:inputText id="ema" value="#{testBean.inputValue}" maxlength="1" />      
        <h:commandButton id="but" value="Submit" action="index"/>
    </h:form>
</h:body>

The page is loaded but not parsed and thus the h: tags are not interpreted by the browser. After searching the web on this it seems that I’m the only one with a problem like this. Maybe I´ve misunderstood some aspects of JSF. I hope to get some advise on this.

  • 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-17T19:53:47+00:00Added an answer on June 17, 2026 at 7:53 pm

    You need to make sure that the request URL matches the URL pattern of the FacesServlet as definied in webapp’s web.xml. It’s namely the one responsible for performing all the JSF/Facelets works.

    For example, if you’ve mapped it on *.jsf, then you should open the page on exactly that URL pattern so that the FacesServlet is properly invoked and will locate the index.xhtml file and do all the necessary stuff.

    window.location.href = "index.jsf";
    

    Alternatively, you can also change the URL pattern of the FacesServlet to *.xhtml. This way you never need to worry about virtual URLs.

    See also:

    • JSF Facelets: Sometimes I see the URL is .jsf and sometimes .xhtml. Why?
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the problem with loading properties from xml inside jUnit test (the same
i have a problem with loading .html pages (with JavaScript inside) into a div
I have a problem with loading data into an < object > using Javascript.
I have a problem with loading image with java 2ME. I have a image
I have problem with google map Loading and making center in my java script
I have have a problem loading and accessing data from a value object in
Ok, so I have no problem loading my ComboBoxes with data from my database
I have problem loading Flash Lite plugin on N8 I have simple QWidget with
I have problem with loading images from the Documents folder of iPhone application into
I have problem with loading resources for UserControl from referenced assembly in Expression Blend

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.