Let’s assume that I want to add a favicon on a dynamically generated page (specifically an ADF Faces page, but this is irrelevant). I can’t modify a tag of my resulted html.
So I try to add a http-header in servlet header. I want my header to be identical to html head element:
<link rel="shortcut icon" href="http://foo.com/favicon.ico">
I’m adding it this way:
httpResponse.addHeader("Link", "<http://foo.com/favicon.ico>; rel=\"shortcut icon\"");
And in my browser I see this header in response:
Link: <http://foo.com/favicon.ico>; rel="shortcut icon"
But, unfortunately, this does not have any effect in IE or Chrome. Anyone tried to achieve the same thing? Am I doing something wrong? Is that should work at all?
And the answer is: this method relies on proposed standard (a draft) that is not implemented yet (thanks to Salman A for pointing this out).
Though it would be great if it worked.