Mysterious Eclipse JSP Validation Errors

前端 未结 16 1958
你的背包
你的背包 2021-01-30 08:50

Eclipse (Helios) occasionally marks valid looking JSP content as having errors. It seems like it often breaks when I use the tag. For example, in a JSP with just th

相关标签:
16条回答
  • 2021-01-30 09:20

    This is an old question but thought I might mention I get this too in Juno on Mac OS X—specifically most often after i change a file externally and then refresh the project in Eclipse. Underlines in all sorts of odd places, even halfway through words in JSP comments.

    Could (likely?!) be related to bug 376926 which apparently got fixed a bit over a week ago?

    0 讨论(0)
  • 2021-01-30 09:24

    For me, while I was typing the line manually, I got an error until I closed the tag, but the error never went away. I found a line of code that was similar, and I deleted the offending code, copy and pasted the the good code, and then made changes inside the tag as needed. No more errors!!! Not an ideal solution, but it worked for me.

    0 讨论(0)
  • 2021-01-30 09:25

    I had the same problem, the problem is the jsp-api library, you can add the dependency to your pom (as explained in other answers) or you can also add the target run-time and eclipse will automatically add that library to your class-path:

    Project -> Properties -> Targeted Runtimes 
    

    And select your server.

    0 讨论(0)
  • 2021-01-30 09:27

    As many of you have mentioned, the issues is around the build path and missing libraries. I found a very simple fix to this build path issue. Here is the solution: Under 'Java Build Path' in eclipse, go to the 'Order and Export' tab, and make sure that the 'Apache Tomcat v7.0' libraries (or whichever version of Tomcat you installed with eclipse) are checked. This instantly fixes the problem. No hassle with anything else. :-)

    There is no need to turn off any validation in that case either.

    0 讨论(0)
提交回复
热议问题