Why not just put it next to WEB-INF/ ?
Or if you need to manipulate it with Wicket (e.g. generate it on the fly)
then use a Wicket Resource which is mounted at /favicon.ico.

On Fri, Mar 18, 2011 at 11:20 AM, Ian Marshall <ianmarshall...@gmail.com>wrote:

> I would appreciate some advice on best practice for favicons in Wicket....
>
> I subclass most of my web pages from a subclass of WebPage. I implement my
> favicon in the way set out at the foot of this posting. I have two types of
> problem.
>
> 1.  When testing the URL "http://localhost:8080/favicon.ico"; on my local
> machine (and a similar, production URL in deployment) I get the error like:
>
>  HTTP ERROR 404 Problem accessing /favicon.ico. Reason: NOT_FOUND
>
>
> 2.  When accessing one of my pages descended from MyBasePage (itself
> subclassed from WebPage and incorporating " ... " in its HTML mark-up), I
> sometimes get the Google App Engine for Java warning:
>
>  org.apache.wicket.markup.html.PackageResource getResourceStream:
>  Unable to find package resource
>  [path = ..., style = null, locale = en_GB]
>
>
> I suspect that I am doing something wrong. Can anyone point me in the right
> direction? Any advice would be greatly appreciated.
>
>
> HTML mark-up
> ------------
> <?xml version="1.0" encoding="UTF-8"?>
> &lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot;
> &quot;http://www.w3.org/TR/html4/strict.dtd&quot;&gt;
>
>
>    ...
>
>    ...
>
>
>
>
> Java code
> ---------
> public class MyBasePage extends WebPage
> {
>  ...
>
>  public MyBasePage(IModel model)
>  {
>    super(model);
>
>    // Both the do-nothing "ResourcesLocator.java" file and my "favicon.ico"
>    // file are in the same resources package.
>
>    ResourceReference rrefFavicon = new ResourceReference(
>     ResourcesLocator.class, "favicon.ico");
>
>    ResourceLink rlnkFavicon =
>     new ResourceLink("lnkFavicon", rrefFavicon);
>
>    add(rlnkFavicon);
>  }
>
>  ...
> }
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Favicon-best-practice-tp3386789p3386789.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>

Reply via email to