java显示netbeans中struts2 select的错误
当我在Netbeans IDE中使用下面的代码时,我在Netbeans中得到了错误指示。但代码运行良好。有人能告诉我为什么在Netbeans中出现错误警告吗。有什么解决办法吗
错误警告在list="#{'01':'Jan', '02':'Feb'}"
<s:select label="Months"
name="months"
headerKey="-1" headerValue="Select Month"
list="#{'01':'Jan', '02':'Feb'}"
value="selectedMonth"
required="true"
/>
错误指示信息如下所示
Encountered ":" at line 1, column 7.
Was expecting one of:
"}" ...
"." ...
"[" ...
">" ...
"gt" ...
"<" .....
# 1 楼答案
Netbeans 7使用JSPEL2.1,它现在使用#字符
此时最简单的解决方案可能是添加映射类:
见答案:Answer