EL语法错误为en [英] EL syntax error is en

查看:76
本文介绍了EL语法错误为en的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

JSP页面中的以下语句在第一次出现等于时遇到错误.请问是什么原因以及如何解决此问题.请尽快纠正我

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'))}

页面加载成功.但是在JBOSS VISUAL STUDIO编辑器中说

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

推荐答案

在JSP EL中,通常使用==(或!=)来比较字符串,而不是.equals():

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,最新版本的JSP EL允许调用方法,但是您的IDE可能已过时,并且不希望使用它. Eclipse以信号错误而不是错误信号而闻名.信任您的应用服务器.

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.

这篇关于EL语法错误为en的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆