获取类型为“html”的错误标记未找到

发布于 2024-11-23 23:11:58 字数 423 浏览 0 评论 0原文

我正在扩展一个类 SomeDetailPage,它扩展了 SomePage,而 SomePage 又扩展了 WebPage。现在这个 SomeDetailPage 工作正常并且没有任何问题。但是我创建了一个新类并扩展了它的一些功能,当我尝试部署它时,我收到错误 org.apache.wicket.markup.MarkupNotFoundException:未找到组件“AboutUs”的“html”类型标记。启用 org.apache.wicket.util.resource 的调试消息以获取尝试过的所有文件名的列表:[Page class = AboutUs,id = 11,version = 0]。我检查过html是否没有复制到包含AboutUs.class的文件夹中,但它在那里,检查命名是否不同,没有用。我找不到为什么我无法运行它,甚至找不到原因,这样我至少可以尝试一种解决方法。我正在使用 Wicket 1.4.8

I am extending a class SomeDetailPage which extends SomePage which in turn extends WebPage. Now this SomeDetailPage is working fine and has no issues. But I have created a new class and extended some of its features and when I am trying to deploy it I am getting the error
org.apache.wicket.markup.MarkupNotFoundException: Markup of type 'html' for component 'AboutUs' not found. Enable debug messages for org.apache.wicket.util.resource to get a list of all filenames tried: [Page class = AboutUs, id = 11, version = 0]. I have checked if the html is not copied into the folder which has AboutUs.class, but it's there, checked if naming was different, no use. I couldn't find why I am not able to run it and couldn't even find out the reason why so that I could atleast try a workaround. I am using Wicket 1.4.8

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

从此见与不见 2024-11-30 23:11:58

我不确定您是否已经这样做了,但是您需要为新类定义标记,并且还需要指定标记层次结构。
因此,如果您的新类名为 AboutUs.java,则 AboutUs.html 将包含 -

<?xml version="1.0" encoding="UTF-8"?>
<wicket:extend xmlns="http://www.w3.org/1999/xhtml" lang="en"
xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd">

    <body ...>
    ...
    </body>
</wicket:extend>

您还需要修改 SomeDetailPage 的标记以在应插入新标记的位置包含以下标记

<wicket:child/>

I'm not sure if you've already done this, but you need to define the markup for your new class, and you also need to specify the markup hierarchy.
So if your new new class is called AboutUs.java, then AboutUs.html will contain -

<?xml version="1.0" encoding="UTF-8"?>
<wicket:extend xmlns="http://www.w3.org/1999/xhtml" lang="en"
xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd">

    <body ...>
    ...
    </body>
</wicket:extend>

You also need to modify the markup for SomeDetailPage to contain the following tag, at the point where your new markup should be inserted

<wicket:child/>
攀登最高峰 2024-11-30 23:11:58

您应该将 wicket 与 maven 原型 一起使用,它可以让您准确解决这个问题。

假设您使用maven(您应该使用maven),源文件夹(如src/main/java)不是资源文件夹(如src/main/resources)。因此,如果您需要将资源从源文件夹复制到输出,则需要将源文件夹添加为 pom.xml 中的资源文件夹:

<build>
    <resources>
        <resource>
            <directory>src/main/java</directory>
            <excludes>
                <exclude>**/*.java</exclude>
            </excludes>
        </resource>
    </resources>
</build>

You should use wicket with the maven archetype, it sets you up to solve exactly this problem.

Assuming you use maven (which you should), a source folder (like src/main/java) is not a resource folder (like src/main/resources). So if you need to copy resources from your source folder to the output, you need to add the source folder as a resource folder in your pom.xml:

<build>
    <resources>
        <resource>
            <directory>src/main/java</directory>
            <excludes>
                <exclude>**/*.java</exclude>
            </excludes>
        </resource>
    </resources>
</build>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文