This little feature is said to be the Easter egg of Spring Boot2.x, which has been around for a long time. I know I haven’t tried it before, but I tried it this time, and it was ok. It was fun. Recently, I started watching Springboot again and saw this part, so I put it into my article. Shit on the street, make it look like shit.
What is banner?
This is the default Spring flag, which sometimes looks ugly, so it doesn’t work if you want to change it, and sometimes slows down your Springboot application. So just watch and play.
Step implementation
In the resource directory of your SpringBoot project, create a new file called banner.txt. What you write in it is what you want to display.
For example, we write: Yu Gong wants to move mountains.
It’s ugly to write. It’s not as good as the old format, but that’s ok, there are some good sites that have done it for us. Just replace the content after the transformation.
- According to input character generated character painting: http://patorjk.com/software/taag/#p=display&f=Doh&t=fengdongdong
- May according to the picture display character: https://www.degraeve.com/img2txt.php
Try using a map
The effect is as follows:
Figure it out for yourself.
Or ugly? Nothing. Keep watching.
It’s an ugly color. It’s okay. Configuration.
Spring provides three enumerated classes to set character colors:
-
AnsiColor: The foreground color used to set the character
-
AnsiBackground: Used to set the background color of a character
-
AnsiStyle: Used to control bold, italic, underlining, etc.
Let’s try a color.
Finally, start it up and see what happens
Gadgets, things are good, do not greedy use!! Thank you