开发者

How to not evaluate a jsp expression?

I have a jsp expression for an attribute of a tag: service=开发者_如何转开发"${service}" and I don't want the ${service} to be evaluated. How to do it?


This is all explained here. Here's an extract of relevance:

Deactivating Expression Evaluation

Because the patterns that identify EL expressions, ${ } and #{ }, were not reserved in the JSP specifications before JSP 2.0, there might exist applications in which such patterns are intended to pass through verbatim. To prevent the patterns from being evaluated, you can deactivate EL evaluation using one of the following methods:

  • Escape the #{ or ${ characters in the page.

  • Configure the application with a JSP Property Group.

  • Configure the page with the page directive.

To escape the #{ or ${ characters in the page, you use the \ character as follows:

some text \#{ some more\${ text
<my:tag someAttribute="sometext\#{more\${text" />

...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜