开发者

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

开发者 https://www.devze.com 2022-12-31 02:50 出处:网络
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\\\'}\">

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

精彩评论

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