1

FreeMarker テンプレート エンジン (v2.3.14) で spring ポートレット mvc (v3.2.9) を使用して、liferay ポータル (v6.2) 用のシンプルなポートレットを開発しています。ポートレットと 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

私はこのチュートリアルに従っていましたhttp://www.liferay.com/web/guest/community/wiki/-/wiki/Main/Alloy+UI+Forms+(aui)/pop_up?_36_version=1.9

問題は間違いなく @aui.model-context です。このタグをフリーマーカーで使用するには?

4

1 に答える 1

1

のように<@aui['model-context'] bean=...>。(,foo.barは , と同等でfoo['bar']あり、その後@は単に一般的な FTL 式であるためです。)

ところで、それらは"${expression}"必要ですか?そこで文字列に変換する必要がありますか?そうでなければ、あなたはただ書くべきだからですaction=editPreferencesUrl

于 2014-08-04T21:00:32.630 に答える