Fetching current page URL in dialog dynamic drop down

Avatar

Avatar

Kiranchonkar

Avatar

Kiranchonkar

Kiranchonkar

30-03-2021

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.

 

 

 

aem6.5 dynamic dropdown

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

asutosh_j3

Avatar

asutosh_j3

asutosh_j3

30-03-2021

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! 

Answers (1)

Answers (1)

Avatar

Avatar

Singaiah_Chintalapudi

MVP

Avatar

Singaiah_Chintalapudi

MVP

Singaiah_Chintalapudi
MVP

30-03-2021

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

Thanks,

Singaiah