Have Eclipse automatically import classes in jsp f

2019-02-16 23:05发布

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条回答
2楼-- · 2019-02-16 23:40

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.

enter image description here


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.

查看更多
登录 后发表回答