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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:20:50+00:00 2026-05-25T00:20:50+00:00

in a JSF facelet page (.xhtml) I have this javascript code <script type=text/javascript> function

  • 0

in a JSF facelet page (.xhtml) I have this javascript code

<script type="text/javascript">
        function navigateToDetail() {
            var id = document.getElementById("idElemento").value;
            alert(id);
            var isPratica = document.getElementById("isPratica").value;
            alert(isPratica);
            var box = "#{boxCtrl.idBox}";
            alert(box);             
            if (isPratica==true)
                window.location = "DettaglioRichiesta.xhtml?id=" + id + "&box=" + box;
            else
                window.location = "../Richieste/DettaglioRichiesta.xhtml?id=" + id + "&box=" + box;

        }
    </script>

It doesn’t work because the jfs engine think that “&box” is relative to a bindign, and it says:

Error Parsing /Box/ListaRichieste.xhtml: Error Traced[line: 20] The reference to entity "box" must end with the ';' delimiter

I can I avoid this behaviour?

  • 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-25T00:20:51+00:00Added an answer on May 25, 2026 at 12:20 am

    Facelets is a XML based view technology. The & is a XML special character. It’s interpreted as start of a XML entity like &nbsp;, &#160;, etc. It is therefore looking for the end character ;, but it found none, so it is throwing this error.

    To represent the & literally inside a XML document, you need to use &amp; instead of &.

    window.location = "DettaglioRichiesta.xhtml?id=" + id + "&amp;box=" + box;
    

    You can also just put that JS code in its own .js file which you include by <script src> so that you don’t need to fiddle with XML special characters in the JS code.

    <script type="text/javascript" src="your.js"></script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a JSF page which is outputting XHTML (from a facelet). One of
I have this simple code in facelets numbers.xhtml: <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html
I have a JSF page with a few fields. I followed this tutorial from
In my JSF page I have a combobox that updates a table when an
I have main page that looks like this: <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html
I want some code in facelet (jsf 2.0) to work: <h:inputText id=q /> <h:button
I have a JSF page which has a variable number inputText elements containing numeric
Let's say that you have the following Facelet ( Using Facelets 1.1.12 ): edit_item.xhtml
I am using helios 3.6.2. I have an .xhtml opened with Web Page Editor
I have the following JSF table: <?xml version=1.0 encoding=UTF-8?> <!DOCTYPE html PUBLIC -//W3C//DTD XHTML

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.