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" />
...
精彩评论