Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

How to get current run mode of an AEM instance (author or publisher)

Avatar

Level 3

Hi,

How we can know current run mode of AEM instace i.e. Author or Publisher

Similar to getting WCMMode using  WCMMode.fromRequest(request)

Thanks

LM

1 Accepted Solution

Avatar

Correct answer by
Level 10
Please use below code:- <% pageContext.setAttribute("runModes", sling.getService(SlingSettingsService.class).getRunModes().toString()); %>

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10
Please use below code:- <% pageContext.setAttribute("runModes", sling.getService(SlingSettingsService.class).getRunModes().toString()); %>