File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes IDEs, Version Control and other tools and the fly likes JSP Tags are coming up as syntax errors on Eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Reply Bookmark "JSP Tags are coming up as syntax errors on Eclipse" Watch "JSP Tags are coming up as syntax errors on Eclipse" New topic
Author

JSP Tags are coming up as syntax errors on Eclipse

Toni Howlett
Greenhorn

Joined: Jan 18, 2012
Posts: 25
I was in the middle of writing a Javascript function, and then all my JSP tags became Syntax errors saying to remove the %

They were working fine before I added the JS so I even tested it by taking out all the JS I just added and it still says they are errors.

What might be the cause of this?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 12513

JSP tags don't have "%" in them. Scriptlets do.

It's possible that the Eclipse XML/HTML editor got its brains scrambled. That's fairly easy to do. Generally restarting Eclipse clears stuff like that, although a refresh is a good idea, too.

For actual tags (not scriptlets), you can attach an XML catalog where the tags' DOCTYPES resolve to a syntactical reference (DOCTYPE or XML schema) in the catalog. I do this whenever I think I have too much hair and need an excuse to rip some out.

Finally, check to see that you're using the right editor when editing the JSPs (you can right-click on the file in the Navigator view to select an editor). I'm not sure that the strict XML editor would like scriptlets at all.

Then again, neither does Bear. His position is that code belongs in Java classes, not on JSPs, and most experts agree. Scriptlets are mostly just left over from when J2EE was less powerful.


One of the most odious afflictions that Business has inflicted on the modern English language is "pro-active". Most of the time it's simply redundantly used in place of the simple old word "active". And a good deal of the rest of the time it means "You're not overworked enough yet, so go out and find more!"
 
 
subject: JSP Tags are coming up as syntax errors on Eclipse
 
Threads others viewed
Strange behaviour of JSP file
strange checkbox problem
How volume 2 will deal with custom tags?
Difference between translation and compilation errors in a JSP
multiple js and jsp
developer file tools