Eclipse自动导入jsp文件中的类 [英] Have Eclipse automatically import classes in jsp files specifically

查看:240
本文介绍了Eclipse自动导入jsp文件中的类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个被宠坏的Java开发人员,我喜欢将鼠标悬停在我的缺少的类,并选择'import com.package.ClassName'。

I'm a spoiled Java developer, and I like to hover over my missing classes and choose 'Import com.package.ClassName'.

Intellisense在jsp文件中工作?

How do you get Intellisense to work in jsp files?

推荐答案

Ctrl + 空格通常的方式来获取自动完成导入一直对我来说在所有的Eclipse版本中,我记得。

Pressing Ctrl+Space the usual way to get the autocomplete with import has always worked for me in all Eclipse versions as far as I recall.

Ctrl + Shift + O (自动组织导入), Ctrl + 1 (快速修复)等等在JSP中不起作用。但毕竟,Java代码不应该写在JSP文件中。它不仅是一个发展中的噩梦(因为你在Eclipse中遇到自己缺乏适当的工具支持),而且在所有其他颜色中也是不好的。只需在普通Java类中编写Java代码。

Indeed, most other helpful tooling like the Ctrl+Shift+O (auto-organize imports), Ctrl+1 (quick fix) and so on don't work in JSPs. But, after all, Java code should not be written in JSP files at all. It's not only a developing nightmare (as you encountered yourself in lack of proper tooling support in Eclipse), but it's also bad in all other colors. Just write Java code in normal Java classes.

这篇关于Eclipse自动导入jsp文件中的类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆