【问题标题】:Syntax Error in Eclipse when ! char is in jstl tag inside javascript scriptEclipse 中的语法错误! char 在 javascript 脚本中的 jstl 标记中
【发布时间】:2011-02-16 12:38:01
【问题描述】:

我有这个 .jsp 文件:

<script language="javascript">
    <c:if test="1!=2">
    </c:if>
</script>

我在 Eclipse WTP (STS) 中遇到了语法错误,如果我有这个:&lt;c:if test="1==2"&gt; 没有语法错误。 &lt;c:if test="1!=2"&gt;&lt;script&gt;..&lt;/script&gt; 之外的这个文件中是可以的。

【问题讨论】:

  • 你确定你没有忘记 real 代码中的${} 吗? &lt;c:if test="${1!=2}"&gt; 等等...

标签: java javascript eclipse jstl sts-springsourcetoolsuite


【解决方案1】:

当没有语法错误时,Eclipse 经常发出语法错误信号,因为它无法正确解析 JavaScript(或其他组合)内的 HTML 内的 JSTL。

通过在您的服务器上部署并运行代码来测试您的代码。如果它运行,那么您遇到了一个 Eclipse 错误。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-03-19
    • 1970-01-01
    • 2022-01-08
    • 2016-09-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多