Fetching current page URL in dialog dynamic drop down | Community
Skip to main content
Level 2
Mar 30, 2021 3:45 PM UTC
Solved

Fetching current page URL in dialog dynamic drop down

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.

 

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Asutosh_Jena_
Asutosh_Jena_Accepted solution
New Participant
Mar 30, 2021 4:23 PM UTC

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! 

2 replies

Singaiah_Chintalapudi
Level 7
Mar 30, 2021 7:51 PM UTC

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

Thanks,

Singaiah

Translate
Asutosh_Jena_
Asutosh_Jena_Accepted solution
New Participant
Mar 30, 2021 4:23 PM UTC

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! 

Translate