spring boot configuration file properties and YAML Comments


spring boot configuration file properties and YAML Comments


The configuration information acquisition properties and values.

1: application.properties configuration file to add:

image1.png


Directly create the prompts to create.

How references the value in the program?

image2.png



image3.png


Browser access:

image4.png


We can see the value of output.

Description:

Application priority attribute configuration file

image5.png

2: Modify Port

Directly in application.properties in:

server.port=8888

After saving, spring boot will automatically help us restart.

image6.png


We can see the port after the restart it was 8888.

3: Date format:

In the previous lesson when we visited saveuser:

image7.png


Create a time stamp. We need to be modified to normal.

Contact Kaige:

Kaige Java (kaigejava)

Personal blog: www.kaigejava.com


How to configure?

Or add application.properties file:

spring.jackson.date-format = format time.

As shown below:

image8.png

After the setup is complete, access:

image9.png


Date format normal.




Guess you like

Origin blog.51cto.com/kaigejava/2437864