Pramil
Pramil

Reputation: 227

EL syntax error is en

The following statement in JSP page encounters error near first equals occurence.What is the reason and how we can solve this problem.Please rectify me as soon as possible

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

Page is loaded successfully.But in JBOSS VISUAL STUDIO editor says that

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" ... 
    "||" ...

Upvotes: 2

Views: 2315

Answers (1)

JB Nizet
JB Nizet

Reputation: 691735

In the JSP EL, == (or !=) is normally used to compare strings, not .equals():

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

AFAIR, the latest version of the JSP EL allows calling methods, but your IDE is probably out of date and doesn't expect it. Eclipse is well-known for signalling errors that are not errors at all. Trust your app server.

Upvotes: 4

Related Questions