在JSP中,eq和=之间的差异

时间:2022-02-22 20:08:10

What is the difference, if any, between the keyword 'eq' and the operator '==' in JSP Expression Language?

在JSP表达式语言中,关键字“eq”和运算符“==”之间的区别是什么?

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 个解决方案

#1


35  

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.

eq是存在的(以及ne、lt等),因此您可以避免使用XML实体引用( <是一个xml字符,需要转义为<),但是它们也做同样的事情。< p>

See Comparison operators in JSP for more info.

有关更多信息,请参见JSP中的比较操作符。

#1


35  

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.

eq是存在的(以及ne、lt等),因此您可以避免使用XML实体引用( <是一个xml字符,需要转义为<),但是它们也做同样的事情。< p>

See Comparison operators in JSP for more info.

有关更多信息,请参见JSP中的比较操作符。