I just put the favicon.ico at the root of the WebContent directory and don't specify anything in the HTML. I believe browsers look in the root unless specified differently in the html (like you are doing).
BTW... app is on Apache + Tomcat and runs as the root app of the tomcat instance. -----Original Message----- From: Ian Marshall [mailto:[email protected]] Sent: Friday, March 30, 2012 4:14 PM To: [email protected] Subject: Re: Favicon best practice With Wicket 1.5.5, I have tried: In the HTML of my base page I have: <link rel="shortcut icon" type="image/x-icon" href="favicon.ico"/> and in my WebApplication-descended application class, I have: @Override protected void init() { super.init(); ... PackageResourceReference prrFavicon = new PackageResourceReference( ResourcesLocator.class, "favicon.ico"); mountResource("favicon.ico", prrFavicon); } Sadly, the favicon shown remains that stored in web/favicon.ico, not the favicon.ico file stored in the same folder as my ResourcesLocator class. Oh well, I shall just live with the favicon in my web folder, and leave the other one in place "just in case". Ian Marshall wrote > > Alas I am getting MidasTouchCodingExceptions. > > I tried > > protected void init() > { > super.init(); > ... > > // New code > ResourceReference rrefFavicon = new ResourceReference( > ResourcesLocator.class, "favicon.ico"); > IMountableRequestTargetUrlCodingStrategy mrtURLCodingStrategy = > new SharedResourceRequestTargetUrlCodingStrategy("favicon.ico", > rrefFavicon.getSharedResourceKey()); > > // One of: > mount(mrtURLCodingStrategy); > mountSharedResource("favicon.ico", > mrtURLCodingStrategy.getMountPath()); > } > > with > > <link rel="shortcut icon" href="[/]favicon.ico" > type="image/x-icon"/> > > but to no avail. > > I shall try your suggestion when 1.5 comes out, which I am looking > forward to. Thank you again for your suggestions. > -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Favicon-best-practice-tp3386789p4520242.html Sent from the Users forum mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
