Replies

Avatar

Avatar

rohitn62196663

Avatar

rohitn62196663

rohitn62196663

20-10-2017

Thanks bsloki and Jorg Hoh for the suggestion. I also found a similar solution in the following link too:
http://suryakand-shinde.blogspot.in/2016/07/aem-form-submission-handling-post.html

http://suryakand-shinde.blogspot.in/2016/07/aem-form-submission-handling-post.html

As per the above link:

In AEM every page (.html) has a primary type jcr:primaryType = cq:Page and there are set of scripts that are mapped with this primary type which intercepts request and renders a page differently based on factors like selector, type of request method (by default only GET is handled) etc. You can find these mapping scripts for cq:Page under the folder /libs/cq/Page(in AEM 6.2). One of script under this folder is external.POST.jsp and this is the script which is responsible for handling a POST request with “.external” selector. If you look at the implementation of external.POST.jsp you’ll notice that implementation is very simple, it just creates a wrapper around existing POST request and overrides getMethod() method of SlingHttpServletRequestWrapper class so that it returns GET and forward control page URL (by removing selector) with this wrapped request and response object.

I tried this implementation and I was able to redirect my request to a new page and also I am able to capture the request parameters. But the problem I am facing now is once I redirect it to a new page the page keeps on loading again and again. I am thinking the "Sling Post servlet" or "Default Servlet" is getting called again and again. Did anyone face this issue ?

Avatar

Avatar

Jörg_Hoh

Employee

Total Posts

3.1K

Likes

1.1K

Correct Reply

1.1K

Avatar

Jörg_Hoh

Employee

Total Posts

3.1K

Likes

1.1K

Correct Reply

1.1K
Jörg_Hoh
Employee

20-10-2017

You can use the "Recent requests" view in the web console ( /system/console/requests) to actually check what the request is internally doing. Every include and every forward is listed there. Should give you insight what's going on.

Jörg