Details
Description
Automatic linking used in base pages is broken.
The attached quickstart application contains a base page wicket.bugs.autolink.page.base.BasePage which has a relative image reference:
<img src="theme/logo.png" border="1" width="50px" height="50px" />
When accessing this page via http://localhost:8080/base the image is rendered as expected.
The generated HTML output is:
<img src="wicket/resource/wicket.bugs.autolink.page.base.BasePage/theme/logo-ver-1319028241918.png" border="1" width="50px" height="50px"/>
The application contains a second page wicket.bugs.autolink.page.home.HomePage extending the BasePage.
When accessing this page via http://localhost:8080/home the image inherited from the base page is not displayed.
The inherited image reference is rendered as:
<img src="theme/logo.png" border="1" onclick="window.location.href='theme/logo.png';return false;"/>
=> Problem 1: theme/logo.png is not autolinked anymore, it should point to wicket/resource/wicket.bugs.autolink.page.base.BasePage/theme/logo-ver-1319028241918.png
=> Problem 2: for some reasons a onclick event is rendered by Wicket
I configured the Wicket app with:
public void init()
{ super.init(); getMarkupSettings().setAutomaticLinking(true); getResourceSettings().setParentFolderPlaceholder("$up$"); mountPage("/home", HomePage.class); mountPage("/base", BasePage.class); }Attachments
Attachments
Issue Links
- breaks
-
WICKET-4152 NPE in CachingResourceStreamLocator due to the search in parent's markup in Autolink code
- Resolved
- relates to
-
WICKET-4145 Improve AutoLinkResolver
- Resolved