JSP中的Underscore.js模板 [英] Underscore.js Templates Within JSP

查看:58
本文介绍了JSP中的Underscore.js模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Undercore.js模板使用<%=%>进行变量插值.不幸的是,这在JSP(或GSP)中也有解释.有没有办法在JSP中使用Underscore.js模板?

Underscore.js templates use <%= %> for variable interpolation. Unfortunately that is also interpreted in a JSP (or GSP). Is there a way to use Underscore.js templates within JSPs?

推荐答案

根据您链接到的网页:

如果您不是ERB风格的分隔符,则可以更改Underscore的模板设置>使用不同的符号来设置插值代码.

If ERB-style delimiters aren't your cup of tea, you can change Underscore's template settings >to use different symbols to set off interpolated code.

这建议您更改interpolateevaluate正则表达式. 这意味着您可以将<%=%>用法更改为与JSP不冲突的用法.

It suggests you change the interpolate and evaluate regexes. This means you can change the <%= %> usage to something that doesn't conflict with JSP.

这篇关于JSP中的Underscore.js模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆