简体   繁体   English

找不到“html”类型的错误标记

[英]Getting an error Markup of type 'html' not found

I am extending a class SomeDetailPage which extends SomePage which in turn extends WebPage.我正在扩展一个 class SomeDetailPage,它扩展了 SomePage,而后者又扩展了 WebPage。 Now this SomeDetailPage is working fine and has no issues.现在这个 SomeDetailPage 工作正常并且没有问题。 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.但是我创建了一个新的 class 并扩展了它的一些功能,当我尝试部署它时,我收到错误 org.apache.wicket.markup.MarkupNotFoundException:找不到组件“AboutUs”的“html”类型的标记。 Enable debug messages for org.apache.wicket.util.resource to get a list of all filenames tried: [Page class = AboutUs, id = 11, version = 0].启用 org.apache.wicket.util.resource 的调试消息以获取所有已尝试文件名的列表:[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.我检查了 html 是否没有复制到包含 AboutUs.class 的文件夹中,但它在那里,检查命名是否不同,没有用。 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我正在使用 Wicket 1.4.8

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.我不确定您是否已经这样做了,但是您需要为新的 class 定义标记,并且还需要指定标记层次结构。 So if your new new class is called AboutUs.java, then AboutUs.html will contain -因此,如果您的新 class 被称为 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>

You also need to modify the markup for SomeDetailPage to contain the following tag, at the point where your new markup should be inserted您还需要修改 SomeDetailPage 的标记以包含以下标记,在应该插入新标记的位置

<wicket:child/>

You should use wicket with the maven archetype , it sets you up to solve exactly this problem.您应该将检票口与maven 原型一起使用,它可以帮助您解决这个问题。

Assuming you use maven (which you should), a source folder (like src/main/java) is not a resource folder (like src/main/resources).假设您使用 maven(您应该这样做),源文件夹(如 src/main/java)不是资源文件夹(如 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:因此,如果您需要将资源从源文件夹复制到 output,则需要将源文件夹添加为 pom.xml 中的资源文件夹:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM