10

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?

Eric Leschinski
  • 146,994
  • 96
  • 417
  • 335
Paul
  • 101
  • 1
  • 1
  • 3

4 Answers4

9

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.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • Hi, thanks for the fast response. It does indeed work - it's part of a large app which is compiled with an ant build script, and using that it works fine. I've turned off the validation but it still shows the error. Perhaps I should regard this as an annoyance rather than anything bigger. I'll be using Eclipse for future development of the app though so it's a shame it has these problems. Ta, Paul – Paul Jun 04 '10 at 15:20
  • Eclipse and epic fails -_- Also the "activated debug buttons on start" is like a legend, it is always there at every version XD – Bahadir Tasdemir Mar 09 '16 at 13:05
4

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

Community
  • 1
  • 1
raghavsood33
  • 749
  • 7
  • 17
3

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.
uneakharsh
  • 740
  • 6
  • 7
  • Thank you! this answer even seems little unusual, actually it solved all errors. First i set the target runtimes as mentioned above and then i cut and paste all jsp code. – aragon May 04 '23 at 10:37
0

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

Prasad Kothavale
  • 419
  • 4
  • 11