Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Have Eclipse automatically import classes in jsp files specifically

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?

like image 956
tyler Avatar asked Aug 28 '12 17:08

tyler


1 Answers

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.

like image 197
BalusC Avatar answered Sep 23 '22 16:09

BalusC