无法从 WicketStuff 找到资源 org.apache.wicket.mfu.delete:MultiFileUploadField.java
我一直在尝试合并来自 wicketstuff.org 的 MultiFileUpload 示例,但找不到 org 的资源.apache.wicket.mfu.删除。原始代码可以在上面的链接中找到,我现在省略了我的代码,但如果有帮助的话可以包含它。对缺失包的调用发生在 org.apache.wicket.markup.html.form.upload.MultiFileUploadField.java 的 renderHead() 方法中,该方法是只读的。我正在使用 wicket-1.3.1.jar。我在下面的代码中从 org.apache.wicket.markup.html.IHeaderContributor 调用 renderHead() 方法。
任何帮助将不胜感激。
add(new HeaderContributor(new IHeaderContributor() {
@Override
public void renderHead(IHeaderResponse response) {
response.renderOnLoadJavascript("document.getElementById('" + summaryField.getMarkupId() + "').focus()");
}
}));
接下来是我对 MultiFileUploadField() 的调用,其中似乎导致问题的 renderHead() 方法所在。
add(new MultiFileUploadField("fileInput", new PropertyModel(this, "uploads"), 5));
最后这是堆栈跟踪:
2011-02-15 10:46:25,233 [http-8080-2] DEBUG [info.jtrac.wicket.JtracApplication] - i18n failed for key: 'org.apache.wicket.mfu.delete', Class: class org.apache.wicket.markup.html.form.upload.MultiFileUploadField, Style: null, Exception: org.springframework.context.NoSuchMessageException: No message found under code 'org.apache.wicket.mfu.delete' for locale 'en'.
2011-02-15 10:46:25,233 [http-8080-2] ERROR [org.apache.wicket.RequestCycle] - Exception in rendering component: [MarkupContainer [Component id = _header_0, page = info.jtrac.wicket.ItemFormPage, path = 4:_header_0.HtmlHeaderContainer, isVisible = true, isVersioned = true]]
org.apache.wicket.WicketRuntimeException: Exception in rendering component: [MarkupContainer [Component id = _header_0, page = info.jtrac.wicket.ItemFormPage, path = 4:_header_0.HtmlHeaderContainer, isVisible = true, isVersioned = true]]
at org.apache.wicket.Component.renderComponent(Component.java:2497)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1354)
at org.apache.wicket.Component.render(Component.java:2296)
at org.apache.wicket.MarkupContainer.autoAdd(MarkupContainer.java:222)
at org.apache.wicket.markup.resolver.HtmlHeaderResolver.resolve(HtmlHeaderResolver.java:78)
at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1267)
at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1370)
at org.apache.wicket.Page.onRender(Page.java:1446)
at org.apache.wicket.Component.render(Component.java:2296)
at org.apache.wicket.Page.renderPage(Page.java:891)
at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:231)
at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:103)
at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1172)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1241)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1316)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:354)
at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:859)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1555)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.util.MissingResourceException: Unable to find resource: org.apache.wicket.mfu.delete for component: form:fileInput [class=org.apache.wicket.markup.html.form.upload.MultiFileUploadField]
at org.apache.wicket.Localizer.getString(Localizer.java:262)
at org.apache.wicket.Localizer.getString(Localizer.java:112)
at org.apache.wicket.Component.getString(Component.java:1787)
at org.apache.wicket.Component.getString(Component.java:1774)
at org.apache.wicket.markup.html.form.upload.MultiFileUploadField.renderHead(MultiFileUploadField.java:202)
at org.apache.wicket.Component.renderHead(Component.java:2532)
at org.apache.wicket.markup.html.form.FormComponentPanel.renderHead(FormComponentPanel.java:183)
at org.apache.wicket.markup.html.internal.HtmlHeaderContainer$1.component(HtmlHeaderContainer.java:212)
at org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:821)
at org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:836)
at org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:861)
at org.apache.wicket.markup.html.internal.HtmlHeaderContainer.renderHeaderSections(HtmlHeaderContainer.java:203)
at org.apache.wicket.markup.html.internal.HtmlHeaderContainer.onComponentTagBody(HtmlHeaderContainer.java:136)
at org.apache.wicket.Component.renderComponent(Component.java:2459)
... 36 more
I have been trying to incorporate the MultiFileUpload example from wicketstuff.org but can not find the resource for org.apache.wicket.mfu.delete. The original code can be found at the above link, and I have ommitted my code for now but can include it if it would help. The call to the missing package takes place within the renderHead() method of org.apache.wicket.markup.html.form.upload.MultiFileUploadField.java, which is read-only. I am using wicket-1.3.1.jar. I am calling the renderHead() method from org.apache.wicket.markup.html.IHeaderContributor within my code below.
Any help will be greatly appreciated.
add(new HeaderContributor(new IHeaderContributor() {
@Override
public void renderHead(IHeaderResponse response) {
response.renderOnLoadJavascript("document.getElementById('" + summaryField.getMarkupId() + "').focus()");
}
}));
and next is my call to MultiFileUploadField() where the renderHead() method that appears to be causing the problems resides.
add(new MultiFileUploadField("fileInput", new PropertyModel(this, "uploads"), 5));
and finally this is the stacktrace:
2011-02-15 10:46:25,233 [http-8080-2] DEBUG [info.jtrac.wicket.JtracApplication] - i18n failed for key: 'org.apache.wicket.mfu.delete', Class: class org.apache.wicket.markup.html.form.upload.MultiFileUploadField, Style: null, Exception: org.springframework.context.NoSuchMessageException: No message found under code 'org.apache.wicket.mfu.delete' for locale 'en'.
2011-02-15 10:46:25,233 [http-8080-2] ERROR [org.apache.wicket.RequestCycle] - Exception in rendering component: [MarkupContainer [Component id = _header_0, page = info.jtrac.wicket.ItemFormPage, path = 4:_header_0.HtmlHeaderContainer, isVisible = true, isVersioned = true]]
org.apache.wicket.WicketRuntimeException: Exception in rendering component: [MarkupContainer [Component id = _header_0, page = info.jtrac.wicket.ItemFormPage, path = 4:_header_0.HtmlHeaderContainer, isVisible = true, isVersioned = true]]
at org.apache.wicket.Component.renderComponent(Component.java:2497)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1354)
at org.apache.wicket.Component.render(Component.java:2296)
at org.apache.wicket.MarkupContainer.autoAdd(MarkupContainer.java:222)
at org.apache.wicket.markup.resolver.HtmlHeaderResolver.resolve(HtmlHeaderResolver.java:78)
at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1267)
at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1370)
at org.apache.wicket.Page.onRender(Page.java:1446)
at org.apache.wicket.Component.render(Component.java:2296)
at org.apache.wicket.Page.renderPage(Page.java:891)
at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:231)
at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:103)
at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1172)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1241)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1316)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:354)
at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:859)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1555)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.util.MissingResourceException: Unable to find resource: org.apache.wicket.mfu.delete for component: form:fileInput [class=org.apache.wicket.markup.html.form.upload.MultiFileUploadField]
at org.apache.wicket.Localizer.getString(Localizer.java:262)
at org.apache.wicket.Localizer.getString(Localizer.java:112)
at org.apache.wicket.Component.getString(Component.java:1787)
at org.apache.wicket.Component.getString(Component.java:1774)
at org.apache.wicket.markup.html.form.upload.MultiFileUploadField.renderHead(MultiFileUploadField.java:202)
at org.apache.wicket.Component.renderHead(Component.java:2532)
at org.apache.wicket.markup.html.form.FormComponentPanel.renderHead(FormComponentPanel.java:183)
at org.apache.wicket.markup.html.internal.HtmlHeaderContainer$1.component(HtmlHeaderContainer.java:212)
at org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:821)
at org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:836)
at org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:861)
at org.apache.wicket.markup.html.internal.HtmlHeaderContainer.renderHeaderSections(HtmlHeaderContainer.java:203)
at org.apache.wicket.markup.html.internal.HtmlHeaderContainer.onComponentTagBody(HtmlHeaderContainer.java:136)
at org.apache.wicket.Component.renderComponent(Component.java:2459)
... 36 more
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据错误消息,.properties 文件中没有为 multifileupload 字段的
delete
字符串定义字符串。我想您需要在您的
Application.properties
(一个与您的Application
类同名的属性文件,但扩展名为 .properties)中定义这个文件,使用以下语法:According to the error message there is no string defined in a .properties files for the multifileupload field's
delete
string.I imagine that you need to define this one in your
Application.properties
(a properties file with the same name as yourApplication
class, but with extension .properties), using the following syntax: