Logico Javascript Operator Error on JSF page

Asked

Viewed 997 times

0

I have a JSF page where I use the primefaces. When I use the logic operator in my javascript functions, it displays this problem: the entity name must immediately follow the '&' in the entity reference.

1 answer

0


You will need to escape the XML entities.

<h:outputText value="Tom &amp; Jerry" />

This problem is not related to the JSF itself, but with the visualization technology, you would need to ensure that the model is well formed XML and that all the special characters that must be represented as is, have been escaped as above.

List of predefined character entities that need to be escaped in XML whenever you would like to display them. Are the following character entities:

"     &quot;
&     &amp;
'     &apos;
<     &lt;
>     &gt;
  • I don’t want to display them. I want to compare two situations in javascript: if (operator1 && operator2) { // Do something }

  • It is not only to display them, but also in ternaries within the interpolation of the JSF or primefaces. Please update your question with the relevant code snippets. And even inside the js block, if the file extension is xhtml the solution is this. You tested @Luizfelipe?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.