Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Fetching current page URL in dialog dynamic drop down

Avatar

Level 2

Hello,

 

I am working on aem 6.5

My requirement is to get current page URL in the dynamic drop down servlet.

Currently when I fetch request.getPath it is giving me location of the component in apps folder and not the page where component is added.

So I am trying to get /content/abc/home/jrc:content and fetch page propedties there. Since m not aware of the page location this is creating problem to do further work. Anyone faced similar problem? Kindly guide me.

 

 

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @Kiranchonkar 

Can you check the referrer header in the request object and see what it returns?

final String referrer = request.getHeader(HttpHeaders.REFERER);

 

Thanks! 

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hi @Kiranchonkar 

Can you check the referrer header in the request object and see what it returns?

final String referrer = request.getHeader(HttpHeaders.REFERER);

 

Thanks! 

Avatar

Community Advisor

Try with either getServletPath() or getRequestUrl()/getRequestUri(). One of these should work.

Thanks,

Singaiah