MonoThreaded
MonoThreaded

Reputation: 12073

Eclipse one JSP showing black but not others

One particular JSP file is now rendered in black&white when it used to be syntax colored
Other JSP files in the same project are rendered correclty.
I tried to cut portions of the code thinking of a syntax error, but it didn't change anything.

What can cause that behavior?

Edit:
Since the syntax was good and restarting Eclipse didn't help, I simply copy/pasted the code in a new file, deleted previous and renamed new to previous. Cheesy, but works.
I would still like to understand...

Upvotes: 0

Views: 2619

Answers (2)

Franz Ebner
Franz Ebner

Reputation: 5106

Recently I just ran into the same Issue...

Adding this:

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>

to my .jsp (and reopening the file) solved my problem.

And don't forget to open it in the JSP Editor

JSPEditor

Maybe you opened it in Text Editor last time?

Upvotes: 3

Captain GouLash
Captain GouLash

Reputation: 1287

I had this problem too. Do you include taglibs?

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%

Something like this could be the error ( no > in the end ). Are you in Java EE perspective?

If nothing helps, just create a new JSP, write some valid code(so syntax highlighting is assured) and then copy paste your "black&white" code into it. If the highlighting disappears, you can be sure you have some syntax mistakes. Also the good old "restart eclipse" may also help.

Upvotes: 1

Related Questions