Expand my Community achievements bar.

Nomination window for the Adobe Community Advisor Program, Class of 2025, is now open!
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

Level 10

Here is a community code example:

http://wemcode.wemblog.com/check-run-mode

Avatar

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