David Antelo
David Antelo

Reputation: 533

Weird problem with my favicon, not showing up in some views

My favicon is in my web root folder, and most of my jsp views work just fine with it. All I have done is add:

<link href="favicon.ico" rel="icon" type="image/x-icon" />

to my and it seemed to work fine.

That was until I realized it wasn't showing up in some of my views. I read through the whole code, to see any differences, but I found none. After a while, I decided to copy and paste the code from the view that I had my favicon working to the one that didn't. And here's the weird thing: it still just shows up in one of the views. I have tried several browsers and it still doesn't show up in a view that literally has the same code (and gives no console errors) as the other one. Both views are in the same folder. How on earth is this even possible?

Upvotes: 0

Views: 281

Answers (1)

Jason
Jason

Reputation: 11832

If any of your JSPs show in the browser with a different path (other than root), then the relative path you've specified for the favicon will look in the same path for it and not find it. If you use an absolute path for your favicon, they should all be able to see it.

Upvotes: 1

Related Questions