Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse Ganymede not validating JSPs properly

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"%>
like image 469
bpapa Avatar asked Sep 27 '08 17:09

bpapa


1 Answers

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.

like image 69
Greg Avatar answered Oct 11 '22 15:10

Greg