How the Spring project reads the configuration file and makes the configuration in it take effect

use Thymeleaf to say that you want to add dependencies

<dependency>
    <groupId>net.sourceforge.nekohtml</groupId>
    <artifactId>nekohtml</artifactId>
    <version>1.9.22</version>
</dependency>

and change the configuration properties of application.properties or application.yml

spring.thymeleaf.mode=LEGACYHTML5

but I used to be a SpringMvc project, and this application.properties file is newly built. I think it"s okay for me to read it, but this setting doesn"t work. Read the substitution code

.
<bean id="propertyConfigurer"       class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="locations">
            <list>
                <value>classpath:application.properties</value>
            </list>
        </property>
</bean>
@ImportResource("classpath:other-config.xml")

the problem now is that it is only read, but the configuration in it has no effect

clipboard.png

Dec.08,2021
Menu