我的vm文件中有一个复选框,如下所示:
<input name="ISPOperatorList[0].ISPOperatorAccessStatus" id="OPERATORAccessDeny0"
#if( $!serviceProviderBean.ISPOperatorList[0].ISPOperatorAccessStatus == "no") checked="checked" #end
class="checkBoxRadio" type="checkbox" value="no" />
我已添加#if
条件以检查预定义的“否”值是否来自后端。如果有,我会勾选复选框。
我在加载页面时遇到此错误:
org.apache.velocity.exception.ParseErrorException: Encountered "[" at admin/ispEnrollmentPage.vm[line 203, column 91]Was expecting one of:
<RPAREN> ...
<WHITESPACE> ...
"-" ...
"+" ...
"*" ...
"/" ...
"%" ...
<LOGICAL_AND> ...
<LOGICAL_OR> ...
<LOGICAL_LT> ...
<LOGICAL_LE> ...
<LOGICAL_GT> ...
<LOGICAL_GE> ...
<LOGICAL_EQUALS> ...
<LOGICAL_NOT_EQUALS> ...
答案 0 :(得分:2)
我也遇到过类似的问题。
唯一的解决方案是使用get(index)
代替[index]
<input name="ISPOperatorList[0].ISPOperatorAccessStatus" id="OPERATORAccessDeny0"
#if( $!serviceProviderBean.ISPOperatorList.get(0).ISPOperatorAccessStatus == "no") checked="checked" #end
class="checkBoxRadio" type="checkbox" value="no" />