# How can I tell from code if i'm looking at a page in Experience Manager

**URL:** <https://community.bloomreach.com/t/how-can-i-tell-from-code-if-im-looking-at-a-page-in-experience-manager/2648>\
**Category:** Experience Manager (PaaS/OnPrem)\
**Created:** [June 29, 2021, 1:00pm UTC](https://community.bloomreach.com/t/how-can-i-tell-from-code-if-im-looking-at-a-page-in-experience-manager/2648 "2021-06-29T13:00:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![samwest88](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/samwest88/32/814_2.png) [@samwest88](https://community.bloomreach.com/u/samwest88)\
**Post date:** [June 29, 2021, 1:00pm UTC](https://community.bloomreach.com/t/how-can-i-tell-from-code-if-im-looking-at-a-page-in-experience-manager/2648/1 "2021-06-29T13:00:49Z")

</div>

Hello.

I would like to be able to tell from code (from a component’s class in java) whether the user is looking at it in Experience Manager (edit mode) or from the front end of the website. I presume there is a method somewhere I can call that will return true/false to tell this?

Cheers,

Sam

---

<div class="post-metadata">

**Author:** ![machak](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/machak/32/1298_2.png) [@machak](https://community.bloomreach.com/u/machak)\
**Post date:** [June 29, 2021, 2:49pm UTC](https://community.bloomreach.com/t/how-can-i-tell-from-code-if-im-looking-at-a-page-in-experience-manager/2648/2 "2021-06-29T14:49:56Z")

</div>

documented here:

> **[Detect Preview or Channel Manager Request Context - Bloomreach Experience -...](https://documentation.bloomreach.com/14/library/concepts/channels/jsp-code-to-find-out-whether-a-request-is-a-preview-or-cms-request.html)**
>
> Headless digital experience platform

---

<div class="post-metadata">

**Author:** ![samwest88](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/samwest88/32/814_2.png) [@samwest88](https://community.bloomreach.com/u/samwest88)\
**Post date:** [June 29, 2021, 3:45pm UTC](https://community.bloomreach.com/t/how-can-i-tell-from-code-if-im-looking-at-a-page-in-experience-manager/2648/3 "2021-06-29T15:45:10Z")

</div>

Perfect, exactly what I was looking for thanks. Marking as solution.
