JSTL、jsp 和 Dojo 解析问题
JSTL, jsp and Dojo parsing issue
我有一个带有 templateString 的 dojo 小部件,看起来像
<div>${buttonLabel}</div>
。该小部件位于 jstl/jsp.
当 jsp 被解析时,${buttonLabel}
被解析为空,现在模板变为 <div></div>
,dojo 模板混合无法识别以替换字符串。
有没有办法避免服务器中的 jstl/jsp 解析?
您可以在模板的 JS 文件中为 ${buttonLabel} 设置任何默认值。
buttonLabel: 'someValue',
//other code
constructor:function(){
}
我找到了解决此问题的方法。问题是 JSP 变量语法与 DOJO 的语法相同,您必须使用 \ 转义 dojo 的变量
****${buttonLabel}
我有一个带有 templateString 的 dojo 小部件,看起来像
<div>${buttonLabel}</div>。该小部件位于 jstl/jsp.
当 jsp 被解析时,${buttonLabel}
被解析为空,现在模板变为 <div></div>
,dojo 模板混合无法识别以替换字符串。
有没有办法避免服务器中的 jstl/jsp 解析?
您可以在模板的 JS 文件中为 ${buttonLabel} 设置任何默认值。
buttonLabel: 'someValue',
//other code
constructor:function(){
}
我找到了解决此问题的方法。问题是 JSP 变量语法与 DOJO 的语法相同,您必须使用 \ 转义 dojo 的变量 ****${buttonLabel}