Mount Points (Quick)
Mountpoints are the translations for your page endpoints. This one is done in Wicket in various ways.
Automounting
The most simple way to mount your page is a Pax-Wicket annotation. It's enough to add the following to your page:
@PaxWicketMountPoint(mountPoint = "automounted")
public class AutomountedPage extends WebPage {
}
That's it; no more magic and your page will show up where you configured it.
Manually mounting
In case you need some more complex strategies than a BookmarkablePage mount you'll need to do so manually. Therefore create a new class implementing the Pax-Wicket PageMounter interface...
public class ManuallyPageMounter implements PageMounter {
... and implement the getMountPoints method:
public List<MountPointInfo> getMountPoints() {
List<MountPointInfo> mountPoints = new ArrayList<MountPointInfo>();
mountPoints.add(new MountPointInfo() {
public String getPath() {
return "manuallymounted";
}
public IRequestTargetUrlCodingStrategy getCodingStrategy() {
return new BookmarkablePageRequestTargetUrlCodingStrategy("manuallymounted",
ManuallyMountedPage.class, null);
}
});
return mountPoints;
}
Finally you need to register the mount point in the OSGi registry. This could be done via any method you like. The following example shows how it is done using blueprint:
<service interface="org.ops4j.pax.wicket.api.PageMounter">
<service-properties>
<entry key="pax.wicket.applicationname" value="blueprint.mount" />
</service-properties>
<bean class="org.ops4j.pax.wicket.samples.blueprint.mount.internal.ManuallyPageMounter" />
</service>
Full sample
The full sample code can be retrieved here.