0

我正在尝试使用 new Dialog() 在注册链接上打开一个对话框,如下所示“注册”和“注册面板”这是我作为 wicket:id="register" 和 wicket:id="registerpanel" 添加到 html 页面中的两个 div .

//注册面板

registerDialog = new Dialog("register");
registerDialog.add(new CustomerRegistrationPanel("registerpanel", registerDialog));
add(registerDialog);

        // Register
        lnkRegister = new AjaxFallbackLink<String>("lnkRegister") {

            @Override
            public void onClick(AjaxRequestTarget ajaxRequestTarget) {
                // ajaxRequestTarget.add(registerPanel);
                registerDialog.open(ajaxRequestTarget);
                //setResponsePage(CustomerProfilePage.class);
            }

            @Override
            public boolean isVisible() {
                return !ZipSession.get().isValid();
            }
        };
        add(lnkRegister);

但是我遇到了一个错误,

根本原因:

org.apache.wicket.markup.MarkupNotFoundException: Failed to find markup file associated. CustomerRegistrationPanel: [CustomerRegistrationPanel [Component id = register]]
at org.apache.wicket.markup.html.panel.AssociatedMarkupSourcingStrategy.getMarkup(AssociatedMarkupSourcingStrategy.java:97)
at org.apache.wicket.MarkupContainer.getMarkup(MarkupContainer.java:448)
at org.apache.wicket.Component.getMarkup(Component.java:737)
at org.apache.wicket.Component.getMarkupTag(Component.java:1422)
at org.apache.wicket.Component.getMarkupIdFromMarkup(Component.java:777)
at org.apache.wicket.Component.getMarkupIdImpl(Component.java:1479)
at org.apache.wicket.Component.getMarkupId(Component.java:1525)
at org.apache.wicket.Component.getMarkupId(Component.java:1592)
at com.visural.wicket.component.dialog.Dialog$1.getDivId(Dialog.java:68)
at com.visural.wicket.component.dialog.Dialog$1.getJS(Dialog.java:59)
at com.visural.wicket.component.dialog.Dialog$1.renderHead(Dialog.java:54)
at org.apache.wicket.Component.renderHead(Component.java:2707)
at org.apache.wicket.markup.renderStrategy.ChildFirstHeaderRenderStrategy$1.component(ChildFirstHeaderRenderStrategy.java:82)
at org.apache.wicket.markup.renderStrategy.DeepChildFirstVisitor.visit(DeepChildFirstVisitor.java:96)
at org.apache.wicket.markup.renderStrategy.DeepChildFirstVisitor.visit(DeepChildFirstVisitor.java:87)
at org.apache.wicket.markup.renderStrategy.DeepChildFirstVisitor.visit(DeepChildFirstVisitor.java:87)
at org.apache.wicket.markup.renderStrategy.DeepChildFirstVisitor.visit(DeepChildFirstVisitor.java:87)
at org.apache.wicket.markup.renderStrategy.DeepChildFirstVisitor.visit(DeepChildFirstVisitor.java:51)
at org.apache.wicket.markup.renderStrategy.ChildFirstHeaderRenderStrategy.renderChildHeaders(ChildFirstHeaderRenderStrategy.java:77)
at org.apache.wicket.markup.renderStrategy.ChildFirstHeaderRenderStrategy.renderHeader(ChildFirstHeaderRenderStrategy.java:56)
at org.apache.wicket.markup.html.internal.HtmlHeaderContainer.onComponentTagBody(HtmlHeaderContainer.java:134)
at org.apache.wicket.markup.html.panel.DefaultMarkupSourcingStrategy.onComponentTagBody(DefaultMarkupSourcingStrategy.java:72)
at org.apache.wicket.Component.internalRenderComponent(Component.java:2556)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1534)
at org.apache.wicket.Component.internalRender(Component.java:2386)
at org.apache.wicket.Component.render(Component.java:2314)
at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1432)
at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1596)
at org.apache.wicket.Page.onRender(Page.java:907)
at org.apache.wicket.markup.html.WebPage.onRender(WebPage.java:140)
at org.apache.wicket.Component.internalRender(Component.java:2386)
at org.apache.wicket.Component.render(Component.java:2314)
at org.apache.wicket.Page.renderPage(Page.java:1035)
at org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:105)
at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:224)
at org.apache.wicket.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:167)
at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:784)
at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:255)
at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212)
at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:283)
at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)
at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:244)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:403)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:301)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:162)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:140)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)

请帮我解决这个问题。提前致谢。

4

3 回答 3

13

即使您已正确命名并放置了 html 文件,如果您在其中使用了错误的根元素,也会出现此错误。

例如以<wicket:extend...>代替开头<wicket:panel...>

于 2013-06-20T08:42:16.557 回答
4

当我遇到这个问题时,我没有在这个问题中找到答案,所以我回来给出我找到的解决方案。这是我对这个问题的检查清单。

  • 检查所有 <wicket:extend>、<wicket:child> 和 <wicket:panel> 和标签是否正确(通过 thoredge 和 Nicky)
  • 检查同一目录中是否有 .html 和 .java 检票口文件(作者:Robert Niestroj)
  • 检查是否没有任何设置可以在 .html 文件的不同位置进行检票口搜索。
  • 检查路径中是否区分大小写的任何操作系统差异(请参阅评论:HaMMeReD)
  • 检查 .html 文件是否也在构建时复制到与 .class 文件相同的目录。
  • 检查 .html 是否也添加到 .war 文件中。

希望这可以帮助那些也忘记了他们的 ant 构建文件中的那一行的人;)

于 2014-04-22T13:19:33.437 回答
1

您似乎缺少html该类的文件CustomerRegistrationPanel。查找名为的文件CustomerRegistrationPanel.html并查看它是否与 .java 文件位于同一目录中。

于 2013-02-01T08:15:50.640 回答