Spring Boot Custom Favicon Example – How to set custom Favicon in Spring Boot

Spring Boot Custom Favicon example – The default Spring Boot configuration provides the default favicon for the web application. If you start a Spring Boot app and requests /favicon.ico url, Spring will serve its default favicon.

It is very easy to provide custom favicon and override Spring’s default one. All you need to do is to put your favicon.ico file in classpath. I would recommend to put custom favicon.ico in /resources/static folder.
spring boot custom favicon example project structure

Once you put your favicon.ico file under /static folder, Spring will start serving it.

spring boot custom favicon example demo

Spring Boot will read favicon.ico from classpath and serves it for all /favicon.ico requests. You might be thinking from where Spring Boot is serving its default green colored favicon?

spring boot custom favicon original icon

This default Spring Boot favicon is in spring-boot-x.x.x.RELEASE.jar file. In this example I have used Spring Boot 1.5.7.RELEASE so my spring-boot-1.5.7.RELEASE.jar contains favicon.ico file!

spring boot jar contains favicon

Download – Spring Boot Custom Favicon example

As always the source code is available on Github.

Github – spring-boot-custom-favicon-example

The post Spring Boot Custom Favicon Example – How to set custom Favicon in Spring Boot appeared first on ViralPatel.net.



via ViralPatel.net http://ift.tt/2xtuJxv

No comments:

Post a Comment

If you have any question please let me know

Tips to Improve Privacy in Truecaller App on Android Phones

If you use Truecaller app in your Android smartphone or iPhone, you must immediately apply important tips given in this article to improve y...