org.thymeleaf.exceptions.TemplateProcessingException: 链接的拼接 href

huangapple go评论67阅读模式
英文:

org.thymeleaf.exceptions.TemplateProcessingException: Concatenation href

问题

我想要拼接 cloudfront.net/css/sample.css

我收到了以下错误:

> 请求处理失败;嵌套异常为 org.thymeleaf.exceptions.TemplateProcessingException: 无法解析为表达式:"${cloudfrontBaseURL} + css/sample.css"。

英文:

I want to concat cloudfront.net/css/sample.css.

I get the following error:

> Request processing failed; nested exception is org.thymeleaf.exceptions.TemplateProcessingException: Could not parse as expression: "${cloudfrontBaseURL} + css/sample.css".

答案1

得分: 1

你可以这样拼接:

<div th:text="${cloudfrontBaseURL + 'css/sample.css'}"></div>

或者

<div th:text="|${cloudfrontBaseURL}css/sample.css|"></div>

详细信息请参阅:https://www.thymeleaf.org/doc/tutorials/3.0/usingthymeleaf.html#literal-substitutions

英文:

You can concat like this:

&lt;div th:text=&quot;${cloudfrontBaseURL} + &#39;css/sample.css&#39;&quot;&gt;&lt;/div&gt;

or

&lt;div th:text=&quot;|${cloudfrontBaseURL}css/sample.css|&quot;&gt;&lt;/div&gt;

https://www.thymeleaf.org/doc/tutorials/3.0/usingthymeleaf.html#literal-substitutions

huangapple
  • 本文由 发表于 2020年10月7日 14:18:40
  • 转载请务必保留本文链接:https://go.coder-hub.com/64238259.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定