title: Why do ampersands (&) need to be encoded in JSF? Is there a way around this?
body: <p>I often have Javascript on my JSF XHTML pages that has &amp;&amp; in it, which I end up having to encode as <code>&amp;amp;&amp;amp;</code></p>
  
  <p>For example, when I place the following in my JSF XHTML page file:</p>
  
  <pre><code>I am an &amp; sign
  </code></pre>
  
  <p>I get the error:</p>
  
  <pre><code>The entity name must immediately follow the '&amp;' in the entity reference
  </code></pre>
  
  <p>One wayto fix this appears to be to change the '&amp;' to <code>&amp;amp;</code> which I find undesirable to just writing '&amp;'. </p>
  
  <p>It also appears that for cases where I use the '&amp;' in Javascript, I can wrap the Javascript in CDATA tags; when wrapped in CDATA tags, I can then write '&amp;' without having to escape it as <code>&amp;amp;</code>, which is a good workaround to be able to have more readable Javascript code on my page. </p>
  
  <p>But what happens when I want to use the literal '&amp;' elsewhere on the page when it is not within <code>&lt;script&gt;</code> tags and therefore cannot as easily wrap the code in CDATA tags? Must I <em>always</em> escape '&amp;' as <code>&amp;amp;</code> for these cases? </p>
  
  <p>Note trying to use 's ability to escape values and  do not seem to be able to fix the issue</p>