Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Eclipse Code Completion not working in JSP

CQDarren
Level 2
Level 2

Hi everyone,

I have successfully configured my CQ project using maven and eclipse and can import,  I have followed the steps here : http://dev.day.com/docs/en/cq/5-3/developing/developmenttools/developing_with_eclipse.html

As the document suggests I add all the jar files to my build path but the code completion id not working in my JSP.

For example in my JSP I have

resourceResolver.getResource("/content...");

however when I hit control space I do not see any methods on the resourceResolver object.

Does anyone work this way and be able to give me some tips?

Thanks

1 Accepted Solution
Correct answer by
Anonymous
Not applicable

Getting code completion working in Eclipse was a major hurdle for our existing codebase - took quite a bit of fiddling with maven artifacts and their versions, but we ended up getting it working for both Juno and Kepler. Two things that are important:

  1. you need to add the right artifacts not only to your core pom.xml, but also the ui/app pom.xml.
  2. even after getting the dependencies right, eclipse was pretty buggy for us - sometimes JSP code completion stops working and requires a restart, and when we initiate code completion, we have to wait for the popup box to get populated before typing a partial match, otherwise JSTL tags don't show up.
  3. when editing a JSP, make sure you're opening it through the ui/app project and not the parent project.
  4. consider switching to IntelliJ, it handles multi-module maven projects a lot better than eclipse, it can auto-complete EL statements - and has a bunch of other advantages as well 🙂

View solution in original post

1 Reply
Correct answer by
Anonymous
Not applicable

Getting code completion working in Eclipse was a major hurdle for our existing codebase - took quite a bit of fiddling with maven artifacts and their versions, but we ended up getting it working for both Juno and Kepler. Two things that are important:

  1. you need to add the right artifacts not only to your core pom.xml, but also the ui/app pom.xml.
  2. even after getting the dependencies right, eclipse was pretty buggy for us - sometimes JSP code completion stops working and requires a restart, and when we initiate code completion, we have to wait for the popup box to get populated before typing a partial match, otherwise JSTL tags don't show up.
  3. when editing a JSP, make sure you're opening it through the ui/app project and not the parent project.
  4. consider switching to IntelliJ, it handles multi-module maven projects a lot better than eclipse, it can auto-complete EL statements - and has a bunch of other advantages as well 🙂