简体   繁体   English

Struts 2#{}在Netbeans 7.3中给出编译错误

[英]Struts 2 #{} giving compilation error in Netbeans 7.3

I'm using Netbeans 7.3 and I've created a maven Struts 2.3 project. 我正在使用Netbeans 7.3,并且创建了一个maven Struts 2.3项目。

Everything else seems fine, except when I write in JSP something like this : 其他一切似乎都很好,除非我用JSP编写如下内容:

<s:select list="#{'-1':'All Activity','0':'Posts Only','1':'Trades Only'}"

The above code gives error in JSP. 上面的代码给出了JSP中的错误。 Although it used to work fine in 6.9 Seems like a bug to me. 尽管它在6.9中正常工作,但对我来说似乎是个错误。 Any help would be really appreciated. 任何帮助将非常感激。

I've already posted a comment about it on the plugin page, although doesn't seem to me like a plugin issue or so, since maven has nothing to do with NB plugins AFAIK. 我已经在插件页面上对此发表了评论,尽管在我看来,这似乎不是插件问题,因为maven与NB插件AFAIK无关。

In the code above the list is populated using OGNL expression. 在上面的代码中,使用OGNL表达式填充该列表。 That is valid expression, however IDE not always has support it since the OGNL version and plugin version may mismatch. 这是有效的表达式,但是IDE并不总是支持它,因为OGNL版本和插件版本可能不匹配。 You can always exclude it from validation. 您始终可以将其从验证中排除。 But it's not the major problem and you could not pay attention to it. 但这不是主要问题,您无法关注它。

This example uses the same collection and looks fine 这个例子使用相同的集合,看起来不错

<s:select list="#@java.util.LinkedHashMap@{'-1':'All Activity','0':'Posts Only','1':'Trades Only'}"/>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM