[
https://issues.apache.org/jira/browse/WICKET-6578?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16582441#comment-16582441
]
Michael Gerhards commented on WICKET-6578:
------------------------------------------
I use the StatelessResourceLink to display Favicons:
HTML
<head>
<link wicket:id="favicon-196x196" rel="icon" type="image/png" />
</head>
Java
add(new StatelessResourceLink<>("favicon-196x196", new
PackageResourceReference(Favicon.class, "favicon-196x196.png")));
If I understand your comment right, you suggest to mount "favicon-196x196.png"
to an url in the Application.init() and refer to it in the HTML where no Java
is required? I used StatelessResourceLink together with the empty Favicon
anchor class to be save reflection-save at compile time against package
moves/renames of the references. The Favicon is added to the BasePage in my
Template.jar library which does not have an Application.class itself but is
used by many projects. This BasePage implements our corporate design and avoids
code redundancy in our application projects.
> StatelessResourceLink
> ---------------------
>
> Key: WICKET-6578
> URL: https://issues.apache.org/jira/browse/WICKET-6578
> Project: Wicket
> Issue Type: New Feature
> Components: wicket
> Affects Versions: 8.0.0
> Reporter: Michael Gerhards
> Priority: Trivial
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> Wicket provides many Stateless Versions of classes such as StatelessLink. It
> would be nice to also have a StatelessResourceLink:
> Complete code for StatelessResourceLink analogous to StatelessLink:
> public class StatelessResourceLink<T> extends ResourceLink<T> {
> public StatelessResourceLink(String wicketId, ResourceReference
> resourceReference) {
> super(wicketId, resourceReference);
> }
> public StatelessResourceLink(String wicketId, ResourceReference
> resourceReference, PageParameters resourceParameters) {
> super(wicketId, resourceReference, resourceParameters);
> }
> public StatelessResourceLink(String wicketId, IResource resource) {
> super(wicketId, resource);
> }
> @Override
> protected boolean getStatelessHint() {
> return true;
> }
>
> }
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)