JSP-includes

Hi all,

I'm somewhat new to JSP-development with IDEA and couldn't find anything
I could do to get IDEA to make some sense of include-pages - this is
quite bad as it doesn't find e.g. usages...
Is ther a way to let IDEA recognize JSP-includes (I think so, from what
IDEA can do with Java-code)?
Sorry for the stupid question...

kind regards

Messi

4 comments

Hi Messi,

IDEA does recognize both static and dynamic JSP includes. Please provide
more details (code snippet, IDEA version).


0

Dmitry,

We simply have an "include" directory, the JSPs there are mostly "snippets", i.e. code-only (<% %>), sometimes intermingled with some HTML; these
are then simply included into other JSPs with '<%@ include file="include/someFile.jsp"%>' - IDEA doesn't recognize identifiers in the "includes" per se, it
wants to import them etc. - okay, I could live with having little IDEAish editing capabilities within the include-JSPs, the problematic part is that on "find
usages", usages in these JSPs are not found - bad, since I can no more rely on find usages now.
I should add that IDEA does recognize variables declared in the including-page within the included-page, the biggest problem seem to be imports, which aren't
recognized, so no methods can be resolved and thus, everything is "red"; on the other hand, the main-page imports for included page are flagged as "unused".

I'm using Selena b#6963 on JDK6.

kind regards,

Messi

Dmitry Avdeev schrieb:

Hi Messi,

IDEA does recognize both static and dynamic JSP includes. Please provide
more details (code snippet, IDEA version).

0

I'm in the same situation with the product I'm working on. It would be great to see improved support here, but this is not a new issue (same behavior in 5.x and 6.x) and seems like it would be a tough nut to crack.

For example if you have variables declared in an include, to find usages it would have to analyze the rest of the JSP code base to see if this file was included anywhere, and then look through that file (and any further files it includes, etc) to analyze where & how it shows up... I don't really know, but due to the JSP structure it just seems like a tougher problem to solve than finding usages of regular Java elements.

0

Please sign in to leave a comment.