I have this simple JSP page in Eclipse and the first line in the file is:
Eclipse however, puts a yellow warning icon before this line with the following tooltip message:
Multiple annotations found at this line:
– Line breakpoint:index.jsp [line: 1]
– Tag (jsp:directive.page) should be an empty-element tag.
Does anyone know why this is?
UPDATE:
This is my full source script. This is basically the template that Eclipse generates for me when I create a new JSP file based on the XHTML template. I only slightly modified the content to make it do something ‘use full’.
I’m using Eclipse 3.4 (eclipse-jee-ganymede-SR1-linux-gtk.tar.gz) on Ubuntu 8.10 with the Geronimo 2.1 plug-in (I don’t think that matters though). I had this same problem with every version of Eclipse I’ve used so far (3.0 and up)
<%@ page language='java' contentType='text/html; charset=UTF-8' pageEncoding='UTF-8'%> <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> <jsp:useBean id='datetime' class='java.util.Date' /> <html> <head> <title>Hello Geronimo</title> <meta http-equiv='Content-Type' content='text/html; charset=UTF-8' /> </head> <body> <div> <h1>Hello Apache Geronimo!!!</h1>on ${datetime} </div> </body> </html>
It’s an oddity of the DOM validation that happens in the editor even for JSP files, reported in bug 248963 for another situation.
It’s expected to be resolved in WTP 3.0.4 & Ganymede SR2.
So what eclipse and WTP version are you using ?
Can you check if this is still the case when you add the following line just beneath the initial jsp declaration:
as mentioned in bug 257258 (also fixed in WTP 3.0.4 & Ganymede SR2): before WTP3.0.4, this doctype was enough to not show your warning:
(source: eclipsetotale.com)