Java 从Thymeleaf访问Spring中的属性文件

Java 从Thymeleaf访问Spring中的属性文件,java,html,spring-boot,spring-mvc,thymeleaf,Java,Html,Spring Boot,Spring Mvc,Thymeleaf,我有一个带有以下表达式的Thymeleaf模板: <div class="box small"> <img th:src="'${@environment.getProperty('pics.path')} + '/' + ${user.id} + '/' + ${pic}"/> </div> Th

我有一个带有以下表达式的Thymeleaf模板:

 <div class="box small">
                                <img th:src="'${@environment.getProperty('pics.path')} + '/' + ${user.id} + '/' + ${pic}"/>
                            </div>

ThymileAF表达式中存在语法错误-第一个
不正确

这应该起作用:


创建复杂字符串时,使用更具可读性-以下是使用以下语法的示例:


Could not parse as expression: "'${@environment.getProperty('pics.path')} + '/' + ${user.id} + '/' + ${pic}" (template: "joan" - line 528, col 38)