Spring Boot 2.0 (one): Spring Boot 2.0 early adopters-Dynamic Banner

Source: Internet
Author: User

Spring Boot 2.0 offers a number of new features, one of which is a small egg: dynamic Banner, and today we're going to take this for a taste.

Spring Boot Replacement Banner

Let's go back to the Spring Boot 1.0 How to replace the boot Banner, in fact, is very simple, just need to src/main/resources create a new file under the path banner.txt , banner.txt fill in the string content that needs to be printed.

In general, we use third-party tools to help transform content, such as Web sites that convert http://www.network-science.de/ascii/ text into strings, websites: http://www.degraeve.com/img2txt.php You can convert images into strings.

Let's test with Hello World for the startup string:

.__           .__  .__                               .__       .___|  |__   ____ |  | |  |   ____   __  _  _____________|  |    __| _/|  |  \_/ __ \|  | |  |  /  _ \  \ \/ \/ /  _ \_  __ \  |   / __ | |   Y  \  ___/|  |_|  |_(  <_> )  \     (  <_> )  | \/  |__/ /_/ | |___|  /\___  >____/____/\____/    \/\_/ \____/|__|  |____/\____ |      \/     \/                                                  \/ 

src/main/resourcesCreate a new file under the Spring Boot 2.0 project path, banner.txt paste the string above, start the Spring Boot project observation boot log, and discover that Spring Boot 2.0 has replaced the default spring string with Hello Worl D. Description Spring Boot 2.0 also supports 1.0 ways to replace Banner.

Next, test the print dynamic Banner in the Spring Boot 2.0 project using the following GIF:

Also we put the Banner.gif file in the project's src/main/resources Path, start the project to test, output column printing information as follows:

                                                                                                                          ..                                                                           .::*                                                                                                                                                                                                                          ...                                                             .....    ....        ........                                                            . ...  ........                                                                .  .. ......                                                                  ....  ....                                                                     ...  .                                                                                                                                                                                                                   . ..                                                                  **::**..                                                               .*::::::::::*.                                                              .*::::::::::::*.                  .*::::::::::::*.                                            .*::::::::::::*.                                                                  .*::::::::::*. ..                                                                                                                                                                                                                                           **::***.                                                                            ..                                                                     .....  ..                                              .....                      ...  ......                                                                ......  .                                                             ...    .       .....  . ....                                                             .                . ............................   .............                                .................. .........       ...........                  .....    . ...................                   ... . ... ............               .............   .   ...                             ...............            .                                            .........                                         ...........                ..........                                                     ....... ....           ............                                                ........          ........                                                        ........       .... .                          .........      ........                              ........    .........                       ..                      ********..  ......*.. ........                      .                    **::::::::::::**. ........  ...........                 .                   **::::::::::::::::**. .......  ......                     .                  *::::::::::::::::::::*.                    .......  ... ..                 .*::::::::::::::::::::::*.                 .......  ......                    .::::::::::::::::::::::::.                .......  ..........                .::::::::::::::::::::::::. ... ....  .........                 .                    *:::::::::::::::::::::::. ....  .........                 .                     *::::::::::::::::::::::*. ...  .........                  .                     *::::::::::::::::::::*. ....   ........                   .                 **::::::::::::::::**. .........    ... ....                    .                   **::::::::::::**. .........  .             ........           .********..                                                      .........     ....... .      ......*..   .........                                                     .                                          .....        .......                                                    .........          ........     .                                        ............          ............  .. ...........             .                              .............                                        .........               ................                   ....   ..........                 ............. ....    . ......... .                  ..... . .... ...... .........       . ..       .... .............. ....                       ..                                                                                                                                                                                    .............  ...........  ..............                                                                                                   ::.        .*:*                                                            :. *:*      *.    .*:*                                                 .:*.       *:   .*:*.   :.                .:                                          :* :     :.                                  .::::*    :                                      :  :    *         *****.....       *.:   :     :   : .:*         .::::::::::**..  ..     : *                                :   *:           .*:::::::::::::::*.   * * * * * * * * .... * *::-:::::::* *.   *   :.:                           : .* :    .....***::::::::::::::::::::::*.  :: O:*. *   ..   *****:::::::::::::::::::::::::*.   *: o:.    .*::::::::::::::::::::::::::::::::*.      :: *:*: *:.::::::----::-::-----                * O *.-:::::::::::---------:--------  .: o   :                      :  : :   .*::::::::::::::::::::::::::::::::::*. :  .    :                      :  ..   .*::::::::::::::::::::::::::::::::::*.   *  : *                      :   :    .*::::::::::::::::::::::::::::::::::*   :   *:                       .   :*. *o:::-::::::::::::::::-----------:---------:*.   .   :                         :  :  *   .*::::::::::::::::::::::::::::::*.    *:* O *:. *:::::::::::-:--::------------------    : ** :                            :*   *    .*::::::::::::::::::::::::**.  *.. *                              **   *    ..     *::::::::::::::::::::*..     :* * * O.. ..    **::::::::::::**.. .:.   ::: O.: ... *. ******.                                     :  :.                ::: o:.    *:     * *:                                          :.   :       .*:*.     :*    .*::                                            .:*. * *o:.:        .:*.                                                                       .*:                                                                           ...

With the above output we find that spring boot will start with each picture of the GIF, printed in sequence in the log, and the Spring boot project will not start until all the pictures have been printed.

If the directory src/main/resources exists at the same time banner.txt , the banner.gif project will print banner.gif banner.txt the contents of each screen before printing.

What is the use of the project launch Banner, in some large organizations or companies, you can use this feature to customize their own splash screen, increase the team's brand identity.

Spring Boot 2.0 (one): Spring Boot 2.0 early adopters-Dynamic Banner

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.