在 IceFaces 上显示 html 格式的文本

发布于 2024-07-29 01:59:48 字数 122 浏览 3 评论 0原文

我正在数据库中保存 html 和/或富格式文本,并且尝试在 IceFaces 文本字段中显示它,但它没有显示正确的格式(换行符或 url)。
是否有标签或组件可以向我显示正确的富文本或 html 格式?
谢谢!

I'm saving html and/or rich formated text in a database, and I'm trying to show it in an IceFaces text field, but it doesn't show the propper format (line breaks or urls).
Is there a tag or a component that shows me the proper rich text or html format?
Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

雾里花 2024-08-05 01:59:48

尝试:

ice:outputText value="#{your.bean}" escape="false"

try :

ice:outputText value="#{your.bean}" escape="false"

你与清晨阳光 2024-08-05 01:59:48

我只找到了这个可以在 ICEfaces 页面内创建 HTML 的解决方案,使用 Facelets 的输出:

#{backingBean.HTML_delivering_method}

这会将您的 HTML 注入页面中并像您在页面内编写它一样处理它。 尽管如此,您必须测试所有换行符是否都已正确处理。

I only found this solution that can create HTML inside an ICEfaces page, use the output of Facelets:

#{backingBean.HTML_delivering_method}

This injects your HTML in the page and processes it like you have written it inside the page. Although, you have to test if all line breaks are processed correctly.

难得心□动 2024-08-05 01:59:48

事实上,这比我想象的要容易得多......
要使用 ICEFaces 正确输出保存在数据库中的 HTML,您只需使用
标签,并在 value 属性中使用 #{backBean.object.html_txt_field},如下所示:

这就是全部:)

Actually, it's a lot easier than I thought...
To properly output HTML saved on a database using ICEFaces you just have to use the
<ice:outputLabel/> tag, and use in the value attribute #{backBean.object.html_txt_field}, like this:

<ice:outputLabel id="olDescription" value="#{backBean.object.htmlTXTfield}" />

And that was all :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文