Spring boot method for reading static resource files
•
Java
1、 Demand scenario
Sometimes we need to use some static resource files in the project, such as the city information file countries XML, after the project is started, read the data in it and initialize it and write it into the database.
2、 Realize
Static resource file countries XML is placed in the Src / main / resources directory
Use spring's classpathresource to implement:
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码