What is the difference, if any, between the keyword 'eq' and the operator '==' in JSP Expression Language?
In code, what is the difference between:
<c:if test="${var1 eq var2}">some code</c:if>
and
<c:if test="${var1 == var2}">some code</c:if>
The scriptlet is everything inside the <% %> tags. Between these the user can add any valid Scriptlet i.e. any valid Java Code. In AppleScript, a scriptlet is a small script. In Windows, a scriptlet is COM component including a HTML code and a script which may be written in a variety of scripting languages.
You can now include a JSP EL expression in the body of a <jsp:text> tag (or any other tag) with the same ${} syntax you use for attributes.
The default mode for JSP pages delivered using a descriptor from Servlet 2.3 or before is to ignore EL expressions; this provides backward compatibility.
eq
exists (as well as ne
, lt
, etc) so you can avoid using XML entity references (< is an XML character and would need to be escaped as <
, for example), but they do the same thing.
See Comparison operators in JSP for more info.
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