简体   繁体   中英

Getting an error Markup of type 'html' not found

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

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/>

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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