Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse: What are these JSP errors?

Tags:

eclipse

jsp

I've inherited a web application and when setting it up in Eclipse it shows errors in a particular JSP.

The errors have no description associated with them in the Problems view, and clicking them there takes me to the top of the JSP, where the red error underline appears halfway through the string like this:

<%@ page erro[rPage="/basicError.j]sp" %>

[<%@ page import="javax.s]ervlet.ServletContext" %>

Imagine a red 'error' underline under the parts bracketed by [] (bold, etc won't show in this code segment and I can't show the code at all unless it's in a code segment, hence using [ and ].

Other examples of the errors:

enter image description here


Clicking the red 'X' icon to the left of the lines does nothing.

I've tried re-importing the project, refreshing, validating, moving the lines around, etc, but I always get this error.

Does anyone know what's happening here?

like image 880
Paul Avatar asked Jun 04 '10 14:06

Paul


3 Answers

I did try disabling the jsp validation but nothing really worked, so I tried the following and it worked.

  1. Select all the code from your jsp.
  2. copy it in some text editor
  3. delete everything from your jsp.
  4. Save your jsp.[All the red lines should be gone at this step].
  5. Copy and paste your code back in the jsp.
  6. Save your jsp again.
  7. Done.
like image 159
uneakharsh Avatar answered Nov 18 '22 05:11

uneakharsh


The solution that worked for me, is given in this answer.

Go to project properties > Targeted runtimes > Select the checkbox for a runtime (Apache Tomcat 7 in my case).

That's all. Just build the project now and everything will be fine

like image 30
raghavsood33 Avatar answered Nov 18 '22 04:11

raghavsood33


Run it. Does it work? Then it's again the Eclipse's builtin JSP validator which is an epic fail. Just disable it in workspace preferences through Web > JSP Files > Validation > scroll list to very bottom and set all EL validation settings to Ignore. Also in the main Validation preference uncheck all checkboxes related to JSP. This however doesn't seem to remove every warning/error, but it at least minimizes the annoyance.

like image 8
BalusC Avatar answered Nov 18 '22 04:11

BalusC