1
votes

I am using primefaces 4.0 and I am having problems with p:outputLabel. When It is mixed with any other primefaces component it behaves like escape="false"

This field is not processed even if I specify escape="true"

Example: I have the following html code:

<h:form>
    <p:outputLabel value="&lt;b&gt;TEXT&lt;/b&gt;" escape="true"></p:outputLabel>
    <h:outputLabel value="&lt;b&gt;TEXT&lt;/b&gt; " escape="true"></h:outputLabel>
</h:form>

And for the Output I have this

<b>TEXT</b> <b>TEXT</b>

Which is expected behavior. (I am willing to see HTML tags as text).

But when I will add any other primefaces tag like in example:

<h:form>
    <p:outputLabel value="&lt;b&gt;TEXT&lt;/b&gt;" escape="true"></p:outputLabel>
    <h:outputLabel value="&lt;b&gt;TEXT&lt;/b&gt; " escape="true"></h:outputLabel>
    <p:commandButton value="button"></p:commandButton>
</h:form>

Now even I have escape="true" I get

TEXT TEXT and then the button.

Does any one have experience with this how should I fix this. Any suggestion.

1
Please note that this issue is present also on primefaces 5.0 and on primefaces 3.5.Kjiro
Can't reproduce on 5.0. Are you using a custom renderer/renderkit anywhere in the webapp?BalusC
Nope I created new project just to check this and it behaves like this.Kjiro

1 Answers

1
votes

I solved this issue.

I had this into my pom

<dependency>
        <groupId>com.sun.faces</groupId>
        <artifactId>jsf-api</artifactId>
        <version>2.1.12</version>
    </dependency>
    <dependency>
        <groupId>com.sun.faces</groupId>
        <artifactId>jsf-impl</artifactId>
        <version>2.1.12</version>
    </dependency>

I just downgraded to 2.1.11 and everything works fine.