Unable to find resource org.apache.wicket.mfu.delete from WicketStuff: MultiFileUploadField.java
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
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 your Application
class, but with extension .properties), using the following syntax:
org.apache.wicket.mfu.delete=remove
精彩评论