Paul
Paul

Reputation: 101

Eclipse: What are these JSP errors?

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?

Upvotes: 10

Views: 29405

Answers (4)

raghavsood33
raghavsood33

Reputation: 768

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

Upvotes: 4

Prasad Kothavale
Prasad Kothavale

Reputation: 444

Right Click your project >> Build Path >> Configure Build Path

Step 1: In libraries tab you should have proper version of JRE system library(eg:JRE System Library [JRE7]) and server library(eg: Apache tomcat V7.0) If not then click add library >> JRE System library >> select installed jre version also add library >> server runtime >> select your installed server

Step 2: Go in order and export tab make sure JRE System Library and server library is checked, click ok

Upvotes: 0

uneakharsh
uneakharsh

Reputation: 740

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.

Upvotes: 3

BalusC
BalusC

Reputation: 1108537

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.

Upvotes: 9

Related Questions