eclipse jsp - 没有颜色,代码完成和错误检测

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5315955/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 16:00:09  来源:igfitidea点击:

eclipse jsp - no colors, code completion and error detection

javaeclipse

提问by ufk

I'm trying to find a way to have colors and code completion and error detection in jsp pages. i have

我正在尝试找到一种在 jsp 页面中具有颜色和代码完成以及错误检测的方法。我有

Eclipse Java EE IDE for Web Developers. Version: Helios Service Release 2.

面向 Web 开发人员的 Eclipse Java EE IDE。版本:Helios Service Release 2。

I cannot install anything using the eclipse web tools platform because everything is already installed. any ideas ?

我无法使用 eclipse web 工具平台安装任何东西,因为一切都已安装。有任何想法吗 ?

thanks!

谢谢!

回答by Chris

Are the JSP pages opened with the right editor? Right click on your JSP file -> Open With -> JSP Editor. You can set the editor in Preferences -> General -> Editors -> File Associations.

JSP 页面是否使用正确的编辑器打开?右键单击您的 JSP 文件 -> 打开方式 -> JSP 编辑器。您可以在 Preferences -> General -> Editors -> File Associations 中设置编辑器。

回答by Dave G

Is your project declared as a "Web" or "J2EE" project? If not go into the project facets and add the "Dynamic Web Module" facet to it.

您的项目是声明为“Web”还是“J2EE”项目?如果没有进入项目构面并将“动态 Web 模块”构面添加到其中。

At that point your project /should/ be recognized as a web project and the highlighting and syntax decorations will be enabled.

此时,您的项目/应该/被识别为 Web 项目,并且将启用突出显示和语法修饰。

回答by Sh4m

i solved this issue by doing this :

我通过这样做解决了这个问题:

Right click on your project then go to Properties -> Targeted Runtime -> Apache tomcat

右键单击您的项目,然后转到 Properties -> Targeted Runtime -> Apache tomcat

then restart eclipse.

然后重启eclipse。