intercepting the page request in AEM-6.4 | Community
Skip to main content
Level 4
July 15, 2019

intercepting the page request in AEM-6.4

  • July 15, 2019
  • 1 reply
  • 9658 views
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

joerghoh
Adobe Employee
Adobe Employee
July 16, 2019

What do you mean with "intercept"? You can register a request filter (standard servlet API) and then filter according to all your requirements.

Or are you looking for something different?

Jörg

Level 4
July 16, 2019

Dear Joerg,

Thanks for your help.

Actually My requirement is below.

Intercept HTTP request from thirdparty  (endpoint is abc-services/jax-rs/participant-service/secure/participant/search) to AEM 

Himanshu_Singhal
Community Advisor
Community Advisor
July 24, 2019

Hi jorg,

I have put my contents and code in the my github branch.

GitHub - sunita197881/sunitaworkplace at Intercept-AEM-page

Getting null pointer exception for the below line 

String templatePath =  page.getContentResource().getValueMap().get("cq:template").toString();

But I am not able to figure out why it is coming null pointer.


The easiest way, please debug the code by breaking into multiple statements and check if the value exist in valuemap or not.

Resource contentRes =  page.getContentResource();

ValueMap map =  contentRes.getValueMap();

String templatePath =  map.get("cq:template").toString();

Put the null check and add debug statements or simply debug the code while hitting the servlet and check values. You'll get to know why null pointer!