Have Eclipse automatically import classes in jsp f

2019-02-16 23:15发布

问题:

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.