Eclipse Ganymede not validating JSPs properly

断了今生、忘了曾经 提交于 2019-12-03 13:39:24

I have just downloaded Ganymede 3.4.2 and added WTP 3.0.4 to it and this error has gone for me.

I actually found out what my problem was through the eclipse webtools usergroup. The issue for me was the use of the Spring form custom tag library. If you self-close the tag...

<form:errors path="*" />

...then you get the goofy JSP validation error. If you close the tag as if there was body content...

<form:errors path="*"></form:errors>

Then the error goes away. I need to follow-up with a bug for the Ganymede team.

nitind

It's not actually something about the editor itself.

This usually happens because of
A) custom tags that are missing a start or end tag cause an imbalance in the translation
or
B) is the result improper handling of scripting variable for custom tags by the JSP Validator.

One's a fault in the JSP file and the other's the fault of the validator. Neither will cause this problem in the upcoming WTP 3.0.3 and Ganymede SR2 releases.

I just ran a update for Software Updates->Gynemede Update Site-> "Web and Java EE Development" and the error seems to go away.

Under preferences -> editors -> file associations, you can see which editor(s) are associated with .jsp files. Perhaps it got associated with a wrong editor, and content checking. You can find a reasonably good JSP editor in the Web Tools Platform (WTP) toolkit.

I have the same issue. Whatever JSP editor is in Ganymede does not like my if/else scriptlets:

<%  if(message != null) { %>
    <p id="message"><%=message %></p>
<%  } else { %>
    <p>Please login to view your account information.</p>
<%  } %>

It tells me:

Syntax error on token "}", delete this token
Syntax error on token "catch", Identifier expected
Syntax error, insert "Finally" to complete TryStatement

...on the final closing brace. I have the same file associations as the original poster. I suppose I will try to find another JSP editor in the WTP toolkit, but I was under the impression that came with my build.

This is unfortunately a known bug apparently introduced in Service Release 1 of Ganymede (Eclipse Ganymede SR1, v 3.4.1).

See the following pages for more information:

http://www.coderanch.com/t/106846/IDEs-Version-Control-other-tools/Ganymede-bug-using-jsp-include

http://www.eclipse.org/newsportal/article.php?id=17447&group=eclipse.webtools#17447

The bug is fixed in WTP 3.0.3. Note that to get the fix through the Eclipse "Software Updates" function, you have to manually add the WTP update site to the list of sites that get searched during updates, by using the "Maage Sites..." function and check the Eclipse Webtools site.

Hm, I upgraded to 3.0.3, to no effect. This is happening mostly for <%@ include file="somefile.jsp" %> -style includes. Incredibly frustrating -- makes it very hard to find real errors when I have 300+ of these. Anyone have any luck going back to an earlier version of WTP?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!