【发布时间】:2017-11-13 16:34:47
【问题描述】:
我有一个使用 Hippo CMS Java 框架构建的项目。我创建了一个包含富文本字段的新文档类型。在文档类型 bean 中,我有一个 HippoHtml 类型的属性:
@HippoEssentialsGenerated(internalName = "acm:abstract")
public HippoHtml getAbstract() {
return getHippoHtml("acm:abstract");
}
String 类型的其他字段工作正常:
@HippoEssentialsGenerated(internalName = "acm:title")
public String getTitle() {
return getProperty("acm:title");
}
在 JSP 模板中,我可以检查并显示如下简单属性:
<c:if test="${ not empty result.title }">
<h1>${ result.title }</h1>
</c:if>
但是,对于HippoHtml 属性,我无法让模板识别该字段。我尝试了以下方法:
<%--@elvariable id="result" type="org.acm.beans.CustomDocument"--%>
<c:if test="${ not empty result.abstract}">
${ result.abstract}
</c:if>
...
<c:if test="${ not empty result.abstract }">
<hst:html hippohtml="${ result.abstract }"/>
</c:if>
...
<c:if test="${ not empty result.html.abstract }">
<hst:html hippohtml="${ result.html.abstract }"/>
</c:if>
...
<c:if test="${ not empty result.html.content}">
<hst:html hippohtml="${ result.html.content}"/>
</c:if>
我想调查HippoHtml 类型。我可以在项目文件(或在线)的哪个位置找到org.hippoecm.hst.content.beans.standard.HippoHtml 的类定义,以便查看对象属性和方法?
如何检查文档属性acm:abstract 是否有值,然后将其显示在我的模板中?
【问题讨论】:
-
对于任何寻找 Java 文档的人,我在这里找到了它们 javadoc.onehippo.org/hippo-cms7/7.8.x/site-toolkit/org/hippoecm/…