Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

How to rewrite/redirect properly :redirect parameter in Form Container

Avatar

Level 1

In AEMaaCS, I have a form container that sends emails with set up with "Thank You Page" parameter, which gives me this component configuration:

{
  "redirect": "/content/mywebsite/form",
  "subject": "Hello",
  "sling:resourceType": "core/wcm/components/form/container/v2/container",
  "actionType": "foundation/components/form/actions/mail",
  "action": "/content/usergenerated/mywebsite/formcq-gen1642504415838/",
  "jcr:primaryType": "nt:unstructured",
  "from": "test@test.com",
  "mailto": "test123@test.com",
  "id": "form"
  }

Now, when I submit the form, the form sents :redirect parameter as /content/mywebsite/form.html, so this is unmapped link (my JcrResourceResolverFactory settings will transform it to /form/). Finally, what is happening is the redirection returned to the browser leads to /content/mywebsite/form.html?status=200, which gives me 404 because I have different rewriting rules on dispatcher.

Is there a way to set up redirection properly? I see that the model does not map the redirect parameter whatsoever, should I add some configuration to the service that rewrites other parameters like a:href etc? I am worried this does not work well, because I have another parameter (:formstart) which should not be rewritten in my opinion.

Many thanks for your help!

 

0 Replies