开发者

What causes a lexical analysis error for eclipse in jsp EL validation?

I've got some EL code inside of a JSP tag. The line starts as follows:

<c:if test="${pageCo开发者_开发问答ntext.request.serverName eq \'localhost\'}">

Eclipse throws up an error on this, saying:

Unable to analyze EL expression due to lexical analysis error

I'm unsure what this even means. Is this an eclipse bug? Am I mixing EL and the JSTL tags incorrectly?


Just do it without backslash:

${pageContext.request.serverName eq 'localhost'}

A JSP with that code:

${pageContext.request.serverName eq 'localhost'}
<c:if test="${pageContext.request.serverName eq 'localhost'}">faith</c:if>

renders "true faith" for me. What does "${pageContext.request.serverName}" show?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜