wds
wds

Reputation: 32293

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="${pageContext.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?

Upvotes: 0

Views: 1812

Answers (1)

sinuhepop
sinuhepop

Reputation: 20326

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?

Upvotes: 1

Related Questions