In some JSP pages, I want to the page display
<h4>${id}</h4>
However, EL will try to evaluate "id" variable and leave it to blank(not find the variable) or the actual value.
<h4>123</h4>
I know there is a
<%@ page isELIgnored="false" %>
but this will disable EL for the whole JSP page.
Is there any way to disable EL just for a few lines?
Thanks guys, I also write a post about this. http://www.ke-cai.net/2010/12/jquery-template-markup-and-jsp.html
Backslash is the easiest.
<h4>\${id}</h4>
Edit: I have used this method in conjunction with the offical jQuery Template plugin which has variables of the same syntax.
From the JSP 2.0 spec:
Quoting in EL Expressions
'${'
if the literal ${
is desired and expressions are enabled for the page. For
example, the evaluation of ${'${'}
is '${'
. Note that ${'}'}
is legal, and simply
evaluates to '}'
.So in your case, instead of:
<h4>${id}</h4>
do this:
<h4>${'${'}id}</h4>
It certainly doesn't look pretty but it's what the Java Community Process settled on.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With