Expand my Community achievements bar.

AEM Forms - Pass Values To Thank You Page

Avatar

Level 7

Hi,

I would like to pass variables to a "thank you" page that is shown when my form is submitted.

Currently I am able to do this via the redirect params in post.POST.jsp of my custom submit action.

However, this means that the values are passed in the URL query string parameters.

I have a component on my thank you page that will read values from the request such as "firstName" and display them to the user.

This will work with query string parameters and as sightly protects against XSS it "should" be ok....but I don't really like giving users the ability to tamper with this by altering the query string.

I would much rather pass the values as attributes in the request (or using some other method).

Can I achieve this?

Adding attributes to the slingRequest in post.POST.jsp doesn't work - presumably as a new request is created for the final redirect.

Thanks,

Jim

2 Replies

Avatar

Level 7

Hi Mayank,

Thanks - that does make sense and it is similar to the pattern I am attempting to implement. There is a difference however, this example appears to be quite different in AEM 6.1 where the submit is being handled in it's entirety.

From what I gather in 6.3, a custom submit action can be used (like I am using), but I don't think that is where the final redirect to the thank you page is executed (correct me if I am wrong), because I don't have access to the code where the final redirect takes place (unlike the stack overflow example) I cannot add to the request the attributes that I would later retrieve on the thank you page. I can only add them as parameters, which will be shown in the query string and will not meet my security requirements.

Can you confirm in AEM 6.3 where the actual redirect to the thank you page occurs ?

Thanks,

Jim