我正在使用带有 FreeMarker 模板引擎(v2.3.14)的 spring portlet mvc(v3.2.9)为 liferay 门户(v6.2)开发简单的 portlet。我使用 portlet 和 aui taglibs 来创建页面
<#assign portlet=JspTaglibs["http://java.sun.com/portlet"]>
<#assign aui=JspTaglibs["http://liferay.com/tld/aui"]>
这些标签在大多数情况下都有效,但我对以下代码有疑问
<@aui.form action="${editPreferencesUrl}">
<@aui.model-context bean="${myBean}" />
<@aui.input name="name" />
<@aui.input name="surname" />
</@aui.form>
我得到以下异常
javax.portlet.PortletException: org.springframework.web.util.NestedServletException: View rendering failed; nested exception is freemarker.core.NonNumericalException: Error on line 8, column 11 in preferences.ftl
Expression aui.model is not numerical
Expression context is not numerical
问题肯定是@aui.model-context。如何在免费标记中使用此标签?