You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by SiSi'mon <s_...@purpleblade.net> on 2007/06/07 19:41:39 UTC

newline , paragraph in how to?

If I set escape="false" in <h:outputText> why can't I include HTML in the
text?

thanks

---
Some posts I read say that you can do this:

   <h:outputText
            styleClass="my-text"
            escape="false"
            value="After pressing the Save button, <P>... other html tags
here"/>

but when I do, I get this:

---
SEVERE: Error Rendering View[/web/delegation.xhtml]
com.sun.facelets.FaceletException: Error Parsing /web/delegation.xh
tml: Error Traced[line: 101] The value of attribute "value" associated with
an e
lement type "h:outputText" must not contain the '<' character.
        at
com.sun.facelets.compiler.SAXCompiler.doCompile(SAXCompiler.java:234)


any ideas?
-- 
View this message in context: http://www.nabble.com/newline-%2C-paragraph-in-%3Ch%3AoutputText%3E-how-to--tf3885139.html#a11012354
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: newline , paragraph in how to?

Posted by Mike Kienenberger <mk...@gmail.com>.
This is because you're using an xml file format for your page.
You have to represent a literal <P> using xml escaping -- &lt;P&gt;
When you change your value binding to an EL expression rather than a
string literal, you won't have this issue.

Also, wouldn't it be better to use <BR/> instead of <P>?


On 6/7/07, SiSi'mon <s_...@purpleblade.net> wrote:
>
> If I set escape="false" in <h:outputText> why can't I include HTML in the
> text?
>
> thanks
>
> ---
> Some posts I read say that you can do this:
>
>    <h:outputText
>             styleClass="my-text"
>             escape="false"
>             value="After pressing the Save button, <P>... other html tags
> here"/>
>
> but when I do, I get this:
>
> ---
> SEVERE: Error Rendering View[/web/delegation.xhtml]
> com.sun.facelets.FaceletException: Error Parsing /web/delegation.xh
> tml: Error Traced[line: 101] The value of attribute "value" associated with
> an e
> lement type "h:outputText" must not contain the '<' character.
>         at
> com.sun.facelets.compiler.SAXCompiler.doCompile(SAXCompiler.java:234)
>
>
> any ideas?
> --
> View this message in context: http://www.nabble.com/newline-%2C-paragraph-in-%3Ch%3AoutputText%3E-how-to--tf3885139.html#a11012354
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>