javax.el.MethodNotFoundException 与 ace:fileEntry 组件
我正在尝试使用 ace:fileEntry 组件上传文件 但我不断收到操作方法不存在的错误 这就是我正在尝试的:
1- ace:fileEntry 组件
<h:form>
<ace:fileEntry id="fileEntryComp"
label="File Entry"
relativePath="uploaded"
fileEntryListener="#{userBean.uploadFile}"/>
<h:commandButton value="Upload File" action="#{userBean.uploadFile}"/>
</h:form>
2- UserBean:
public void uploadFile(FileEntryEvent event) {
FileEntry fileEntry = (FileEntry) event.getSource();
FileEntryResults results = fileEntry.getResults();
for (FileEntryResults.FileInfo fileInfo : results.getFiles()) {
if (fileInfo.isSaved()) {
log.debug("########### FILE IS SAVED ########");
}
}
}
Exception:
javax.el.MethodNotFoundException: /uploadFiles.xhtml @32,81 action="#{userBean.uploadFile}": Method not found: [email protected]()
在这种情况下如何设置方法? 有人会告诉我,xhtml 页面中的方法调用应该采用 bean 中的参数,但我会回答我按照此处示例中提到的那样进行操作:
http://wiki.icefaces.org/display/ICE/FileEntry
请告知。
i am trying to use ace:fileEntry component to upload files
but i am keep getting errors that action method doesn't exist
here's what i am trying:
1- ace:fileEntry component
<h:form>
<ace:fileEntry id="fileEntryComp"
label="File Entry"
relativePath="uploaded"
fileEntryListener="#{userBean.uploadFile}"/>
<h:commandButton value="Upload File" action="#{userBean.uploadFile}"/>
</h:form>
2- UserBean:
public void uploadFile(FileEntryEvent event) {
FileEntry fileEntry = (FileEntry) event.getSource();
FileEntryResults results = fileEntry.getResults();
for (FileEntryResults.FileInfo fileInfo : results.getFiles()) {
if (fileInfo.isSaved()) {
log.debug("########### FILE IS SAVED ########");
}
}
}
Exception:
javax.el.MethodNotFoundException: /uploadFiles.xhtml @32,81 action="#{userBean.uploadFile}": Method not found: [email protected]()
how to set the method in this case ?
someone will tell me that the method call in xhtml page should take a parameter as in the bean, but i will answer that i did as mentioned in the example here:
http://wiki.icefaces.org/display/ICE/FileEntry
please advise.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题是我正在使用带有命令按钮的操作方法,这是不必要的,我只需要添加没有操作的命令按钮,现在一切正常。
problem was that i was using action method with the command button which is not necessary, i just needed to add command button with no action, everything works fine now.