Eclipse Ganymede not validating JSPs properly

2019-03-27 09:14发布

I just installed Ganymede and am exploring an old project in it. All of my JSPs are giving me weird validation errors. I'm seeing stuff like -

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

I'm doing best practice stuff here, no scriplets or anything, so I think that Eclipse is incorrectly applying a Java class validator to my JSPs. Any idea on how to stop that from happening?

Under Options/Editors/File Associations I have the following for JSPs:

JSP Editor (default)
Web Page Editor
Text Editor
CSS JSP Editor

Am I missing something?

Also I think this is correct, but just in case it's not, here is my page directive -

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>

8条回答
三岁会撩人
2楼-- · 2019-03-27 10:03

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.

查看更多
Ridiculous、
3楼-- · 2019-03-27 10:04

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.

查看更多
登录 后发表回答