[
https://issues.apache.org/jira/browse/WICKET-3930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13070526#comment-13070526
]
Martin Grigorov commented on WICKET-3930:
-----------------------------------------
The problem is that with <wicket:link><img src="anything.png"/></wicket:link>
Wicket expects that anything.png is in the same package as the markup container
(HomePage.class in the current case).
Since the image is in src/main/webapp Wicket doesn't find it and produces a
link which when clicked will make a request to the image. If the image was next
to HomePage.class then Wicket will produce a link to the image itself (because
Wicket knows that it exists in this package). In the later case everything
works as you expect.
I think this is the design of AutoLinkResolver but since this behavior is no
described in its javadoc I will leave the ticket open so someone else from the
dev team can comment on it.
> wicket:link loads image via onclick() instead of the referenced page when an
> anchor tag includes an img
> -------------------------------------------------------------------------------------------------------
>
> Key: WICKET-3930
> URL: https://issues.apache.org/jira/browse/WICKET-3930
> Project: Wicket
> Issue Type: Bug
> Components: wicket-core
> Affects Versions: 1.4.17
> Environment: Mac OSX 10.7, Java 1.6.0_26
> Reporter: George Armhold
> Labels: linking
> Attachments: wicket-link-bug.tar.gz
>
>
> With the following markup, I expect that clicking on the image will result in
> the browser loading AnotherPage:
> <a href="AnotherPage.html">
> <img src="java-logo.png"/>
> </a>
> Instead, the image itself it shown, due to the onclick() handler that
> wicket:link is adding.
> I will include a quickstart to demonstrate.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira