Have Eclipse automatically import classes in jsp files specifically

旧城冷巷雨未停 提交于 2019-12-19 06:19:27

问题


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

How do you get Intellisense to work in jsp files?


回答1:


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.


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.



来源:https://stackoverflow.com/questions/12164841/have-eclipse-automatically-import-classes-in-jsp-files-specifically

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!