Hi,
When I serve up, say, a PDF file, how do I control the favicon?
Here’s my code:
response.reset(); response.setContentType(IOUtilities.gMIMEType(fn)); response.setHeader(“Content-disposition”, “inline; filename=” + file.getName()); OutputStream outStream = response.getOutputStream(); synchronized(response.getOutputStream()){ outStream.write(IOUtilities.gFile2Bytes(file.getAbsolutePath())); } response.flushBuffer();
Thanks in advance
Thanks for the responses.
When I serve up a pdf file with the code below, it shows it in an embedded acrobat, as desired. However, the icon in the browser (in the tab) is the Tomcat logo.
I’d like to change it to something else.
The usual way to specify the favicon is by putting it at the root of the web site, e.g. http://www.example.com/favicon.ico. On the server, this file is usually found in [Tomcat dir]/webapps/ROOT/favicon.ico – change that file to whatever icon you want.
There are some other ways to specify the favicon, but I don’t know if they’re supported by all browsers.
References: http://www.w3.org/2005/10/howto-favicon http://en.wikipedia.org/wiki/Favicon