Eclipse 方法必须有签名";字符串方法()…[etc]…”;但有一个签名;void方法();
我有一个数据表,每行有一个按钮:Eclipse 方法必须有签名";字符串方法()…[etc]…”;但有一个签名;void方法();,eclipse,validation,jsf,el,eclipse-wtp,Eclipse,Validation,Jsf,El,Eclipse Wtp,我有一个数据表,每行有一个按钮: <ice:dataTable ... var="item"> <ice:column> <h:commandButton value="Download" action="#{mybean.downloadItem(item)}" /> </ice:column> </ice:dataTable> 一切正常(当单击该方法时),但是 Eclipse验证失败,出现以下奇怪消息: 方法必须具
<ice:dataTable ... var="item">
<ice:column>
<h:commandButton value="Download" action="#{mybean.downloadItem(item)}" />
</ice:column>
</ice:dataTable>
一切正常(当单击该方法时),但是
Eclipse验证失败,出现以下奇怪消息:
方法必须具有签名“String Method(),String Method(),String
方法(字符串),字符串方法(字符串,字符串),字符串方法(字符串,
字符串,字符串),字符串方法(字符串,字符串,字符串,字符串),字符串
方法(字符串,字符串,字符串,字符串,字符串),字符串方法(字符串,
字符串,字符串,字符串,字符串,字符串),字符串方法(字符串,字符串,
字符串,字符串,字符串,字符串,字符串),字符串方法(字符串,字符串,
字符串,字符串,字符串,字符串,字符串,字符串,字符串),字符串方法(字符串,
串,串,串,串,串,串,串,串,串,
String方法(String,String,String,String,String,String,String,String,
字符串,字符串,字符串),字符串方法(字符串,字符串,字符串,
字符串,字符串,字符串,字符串,字符串,字符串,字符串,字符串),字符串
方法(字符串,字符串,字符串,字符串,字符串,字符串,字符串,字符串,字符串,
字符串,字符串,字符串,字符串),字符串方法(字符串,字符串,字符串,
串,串,串,串,串,串,串,串,串,
字符串,字符串),字符串方法(字符串,字符串,字符串,字符串,字符串,
串,串,串,串,串,串,串,串,串,
字符串),字符串方法(字符串,字符串,字符串,字符串,字符串,字符串,
串,串,串,串,串,串,串,串,串,
字符串),字符串方法(字符串,字符串,字符串,字符串,字符串,字符串,
串,串,串,串,串,串,串,串,串,
字符串,字符串),字符串方法(字符串,字符串,字符串,字符串,字符串,
串,串,串,串,串,串,串,串,串,
字符串,字符串,字符串,字符串),字符串方法(字符串,字符串,字符串,
串,串,串,串,串,串,串,串,串,
字符串,字符串,字符串,字符串,字符串,字符串,字符串,字符串),字符串
方法(字符串,字符串,字符串,字符串,字符串,字符串,字符串,字符串,字符串,
串,串,串,串,串,串,串,串,串,
字符串,字符串,字符串)“但有签名”void method()
我能做什么
如果相关的话,我在Tomcat7上使用EclipseIndigoSR1。忽略它。月食是个混蛋。您可以通过将窗口>首选项>Web>JavaServer Faces工具>验证>类型分配问题>方法表达式签名不兼容设置为警告或忽略(默认为错误)来调整它 在所有礼貌方面借用的形象 原因是,Eclipse希望
操作
属性总是返回字符串
,而不是无效
。虽然JSFaction
属性中确实没有指定,但EL方法表达式本身实际上也支持void
方法。过度热情的消息反过来表明,负责此验证的底层逻辑无法确定单个方法参数,因此它尝试将原始方法签名与允许的签名集合进行比较,如果未找到匹配项,则最终会在消息中显示这些签名。根据消息,当方法具有20个或更多参数时,此问题也可能消失;)
这在月食Luna SR1中得到了修复,这是在该问题被报道近6年后。严重性已从错误降低为警告。你可能还是想把它放低一点,忽略它
另见:
publicstringdownloadItem(Item Item){…;returnnull;}
会让Eclipse感到高兴,而不会改变应用程序的行为,对吗?
public void downloadItem(Item item) {
// ...
}