Liferay has a somewhat strange layout for it's web-inf and html folders. In Eclipse I never really code path completion to work well in JSPs because it always looked at the wrong spot for files. In IntelliJ I just setup different facets that will help the IDE help me. Here is an example. I have a facet called WEB-INF. In Liferay, when you reference a file in WEB-INF (tagfiles are a GREAT example here) you do it like this:
<%@ taglib prefix="showMore" tagdir="/WEB-INF/tags/wj/showmore" %>
The problem there is that by default, the IDE wants to autocomplete like this:
<%@ taglib prefix="showMore" tagdir="/docroot/WEB-INF/tags/wj/showmore" %>
I simply made a web facet and said that when I type /WEB-INF
I really want you to look at /docroot/WEB-INF
. This small change saves me so much headache throughout the day. I also did the same thing with /html
instead of /docroot/html.
You know how in eclipse when you go to an init.jsp file in the ext environment it always freaks about the init.jsp includes from portal because it can't find it? I once again used a web facet (called portal-web) and I linked / to /liferay/builds/4.3.x/portal-web/docroot
. Now when I say:
<%@ include file="/
right there it starts autocompleting. It lists out everything in both portal-web and ext-web for me, because I have access to both inside Liferay! Doing this then:
<%@ include file="/html/common/init.jsp" %>
it's a problem, I can even click init.jsp and press ctrl (cmd) + b and it will jump me right into the init file in portal.
I tend to run IntelliJ with one "Module" and two "Content Roots". One content root is portal, the other is ext. The plus here is that the debugger knows about the portal source files, and I can easily jump between jsp files as well.
Resource Link:
Why I use IntelliJ instead of Eclipse?