• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP Tags are coming up as syntax errors on Eclipse

 
Toni Howlett
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18098
50
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic