2013-08-24 48 views
2

在JSP頁面中執行以下語句遇到附近的第一誤差等於 occurence.What的原因,以及我們如何解決這個problem.Please儘快EL語法錯誤是連接

${(fn:length(updateStock.todayDimensionStones)==i.count) && (!DimensionStones.status.equals('New')||!DimensionStones.isInspected.equals('No'))} 

頁糾正我被裝載在successfully.But JBOSS Visual Studio編輯器說

Multiple annotations found at this line:- Encountered "(" at line 1, 
    column 86. 
Was expecting one of: 
    "." ... 
    ">" ... 
    "gt" ... 
    "<" ... 
    "lt" ... 
    "==" ... 
    "eq" ... 
    "<=" ... 
    "le" ... 
    ">=" ... 
    "ge" ... 
    "!=" ... 
    "ne" ... 
    ")" ... 
    "[" ... 
    "+" ... 
    "-" ... 
    "*" ... 
    "/" ... 
    "div" ... 
    "%" ... 
    "mod" ... 
    "and" ... 
    "&&;&&;" ... 
    "or" ... 
    "||" ... 

    - EL Syntax Error 
    - Encountered "(" at line 1, 
    column 86. 
Was expecting one of: 
    "." ... 
    ">" ... 
    "gt" ... 
    "<" ... 
    "lt" ... 
    "==" ... 
    "eq" ... 
    "<=" ... 
    "le" ... 
    ">=" ... 
    "ge" ... 
    "!=" ... 
    "ne" ... 
    ")" ... 
    "[" ... 
    "+" ... 
    "-" ... 
    "*" ... 
    "/" ... 
    "div" ... 
    "%" ... 
    "mod" ... 
    "and" ... 
    "&&;&&;" ... 
    "or" ... 
    "||" ... 
+0

錯誤信息說什麼? –

+0

我在問題中添加了錯誤消息 – Pramil

回答

4

在JSP EL,==(或!=),通常使用比較字符串,不.equals()

${(fn:length(updateStock.todayDimensionStones) == i.count) && 
    (DimensionStones.status != 'New' || DimensionStones.isInspected != 'No')} 

AFAIR,最新版本的JSP EL允許調用方法,但是您的IDE可能已過期,並且不期望它。 Eclipse是衆所周知的信號錯誤,根本不是錯誤。相信你的應用服務器。