문제

I have a database column that contains the following:

    <p><span style="color: #ff0000"><strong>$9,500,000.00</strong></span></p>
    <p>$11,000,000.00</p>

In JSF 1.2 and Icefaces 1.8.2, this data would output fine. Under JSF 2.1 and Icefaces 3.0, I get what you see - just plain text.

Here's a snippet of code and the value is in the amount field:

        <ice:column>
            <f:facet name="header">
                <ice:outputText value="Amount"/>
            </f:facet>
            <ice:outputText value="#{offDoc.amount}"/>
        </ice:column>

I tried to wrap the ice:outputText tag with a tag but it didn't work. Any ideas?

도움이 되었습니까?

해결책

You need something like this to turn off HTML escaping:

<ice:outputText value="#{offDoc.amount}" escape="false"/>

See here: http://res.icesoft.org/docs/latest/tld/ice/outputText.html

If the "escape" attribute is not present, or it is present and its value is "true" all angle brackets should be converted to the ampersand xx semicolon syntax when rendering the value of the "value" attribute as the value of the component. If the "escape" attribute is present and is "false" the value of the component should be rendered as text without escaping.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top