In Wicket, you usually link to another html file using a link in Java so that Wicket generates href for you. You can mount the page under the patch URL (called Bookmarkable Link because they are independent of the user's session) or just use the link.
To bookmark with a bookmark, you must do the following in the init () of your Wicket application class:
public class WicketApplication extends WebApplication{ protected void init() { super.init(); mountBookmarkablePage("/ChangeTextOnClick", ChangeTextOnClick.class); mountBookmarkablePage("/HelloWorld", HelloWorld.class); } }
In this case, you can always reach these 2 pages under the specified URL.
You can create a link pointing there using this in MyPage.java:
add(new BookmarkablePageLink<ChangeTextOnClick>("myExampleLink" ,ChangeTextOnClick.class)
and in the corresponding MyPage.html:
<a href="thisGetsReplacedAtRuntime" wicket:id="myExampleLink">Change Text On Click</a>
If you do not want the links to be classified, you do not need the mountBookmarkablePage materials in init () and use the link instead of the BookmarkablePageLink bookmark.
Look at Wicket wicki, you will find there a lot of useful information.
source share