Underscore.js Templates Within JSP

前端 未结 5 969
遥遥无期
遥遥无期 2020-12-13 10:08

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 wit

5条回答
  •  醉话见心
    2020-12-13 10:42

    According to the webpage you linked to:

    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.

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

提交回复
热议问题