Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java noscript中使用的spring模型变量的thymeleaf语法_Java_Spring Boot_Thymeleaf - Fatal编程技术网

Java noscript中使用的spring模型变量的thymeleaf语法

Java noscript中使用的spring模型变量的thymeleaf语法,java,spring-boot,thymeleaf,Java,Spring Boot,Thymeleaf,使用thymeleaf在noscript中检索spring模型值的语法 [${gtmUrl}]]在脚本标记中工作正常,但不适用于noscript 有不同的语法吗 在java控制器中,设置gtmUrl属性 model.addAttribute("gtmUrl", "http://test.com"); 在html中 <noscript> <iframe src="[[${gtmUrl}]]" height="0" width="0" st

使用thymeleaf在noscript中检索spring模型值的语法

[${gtmUrl}]]在脚本标记中工作正常,但不适用于noscript

有不同的语法吗

在java控制器中,设置gtmUrl属性

model.addAttribute("gtmUrl", "http://test.com");
在html中

<noscript>
        <iframe src="[[${gtmUrl}]]"
            height="0" width="0" style="display: none; visibility: hidden"></iframe>
    </noscript>

尝试使用此代码

 <noscript>
            <iframe src="[[@{gtmUrl}]]"
                height="0" width="0" style="display: none; visibility: hidden"></iframe>
        </noscript>

在这里,我使用
@
sing而不是
$

尝试使用此代码

 <noscript>
            <iframe src="[[@{gtmUrl}]]"
                height="0" width="0" style="display: none; visibility: hidden"></iframe>
        </noscript>

这里我使用
@
sing而不是
$

尝试使用th:src=“${gtmUrl}”

 <noscript>
     <iframe th:src="${gtmUrl}" height="0" width="0" style="display: none; visibility: hidden"></iframe>
</noscript>

尝试使用th:src=“${gtmUrl}”

 <noscript>
     <iframe th:src="${gtmUrl}" height="0" width="0" style="display: none; visibility: hidden"></iframe>
</noscript>

更改:

<noscript>
        <iframe src="[[${gtmUrl}]]"
                height="0" width="0" style="display: none; visibility: hidden"></iframe>
</noscript>
通过HTML中的
${key}
获取值

在Thymeleaf中,这些模型属性(或上下文变量) 可以使用以下语法访问ThymileAF(行话):
${attributeName}
,在本例中,attributeName是
。这 是一个春天的表达。简而言之,Spring EL(Spring表达式 语言)是一种支持查询和操作 运行时的对象图

更改:

<noscript>
        <iframe src="[[${gtmUrl}]]"
                height="0" width="0" style="display: none; visibility: hidden"></iframe>
</noscript>
通过HTML中的
${key}
获取值

在Thymeleaf中,这些模型属性(或上下文变量) 可以使用以下语法访问ThymileAF(行话):
${attributeName}
,在本例中,attributeName是
。这 是一个春天的表达。简而言之,Spring EL(Spring表达式 语言)是一种支持查询和操作 运行时的对象图


感谢您的帮助,tharanga dinesh提供的上述解决方案对美沙酮有效。感谢您的帮助,tharanga dinesh提供的上述解决方案对我有效