Expand my Community achievements bar.

SOLVED

Jsp resolution via selector vs include & variable

Avatar

Level 2

In adobe AEM (aka cq), for a given url is it possible to see what jsp's are being invoked?

We've got example code, not written by us where 2 sets of 'base' jsp are being matched if a specific selector is present or not - 'm' for mobile. In the base jsp a variable is then set to flag if a mobile or desktop device is requesting.

From then on no further selectors are used - just checks on the variable to specifically include mobile specific jsp or not.

A different approach from solely using selectors to invoke specific jsp or not.

By having the script resolution traced it helps visualise and debuts, but is this a common pattern for sling based code?

1 Accepted Solution

Avatar

Correct answer by
Level 2

You could see all the JSPs being invoked from recent requests under system console. By default, this just captures the last 20 requests but is configurable.

From maintainability point of view, I would suggest to use specific selector to invoke a particular jsp/code.

Do let me know if you have any other queries.

View solution in original post

1 Reply

Avatar

Correct answer by
Level 2

You could see all the JSPs being invoked from recent requests under system console. By default, this just captures the last 20 requests but is configurable.

From maintainability point of view, I would suggest to use specific selector to invoke a particular jsp/code.

Do let me know if you have any other queries.