difference between eq and == in JSP

倾然丶 夕夏残阳落幕 提交于 2019-12-20 10:19:14

问题


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>

回答1:


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 &lt;, for example), but they do the same thing.

See Comparison operators in JSP for more info.



来源:https://stackoverflow.com/questions/2087721/difference-between-eq-and-in-jsp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!