【问题标题】:How to do a OR in a c:if statement in jsp如何在 jsp 中的 c:if 语句中执行 OR
【发布时间】:2010-10-17 04:15:17
【问题描述】:

我如何正确声明一个 or 声明我尝试这个没有成功:

【问题讨论】:

    标签: jsp jstl


    【解决方案1】:

    按位包含 OR --> |

    逻辑或 --> ||

    所以...

    if ( true || false )
    {
        /* the first expression is evaluated, it is true, we enter the 'if' block */
    }
    
    int i = 1 | 0;  /* i == 1 */
    

    【讨论】:

    • 这不是我发布的内容?
    • 很抱歉,显然是枚举错误,类型路径不存在?你的答案是正确的
    【解决方案2】:

    根据http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSPIntro7.html ||应该管用。使用el时,我一般用'or'代替'||'但我不确定我为什么要这样做。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-04-04
      • 1970-01-01
      • 2013-08-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-03-09
      相关资源
      最近更新 更多