I'm using a custom Magnolia forms module (built internally at my company). When the user successfully submits the form, I want to redirect the user to a success page.
This could be done in the module itself. However, if the user does not successfully submit the form (e.g. missing required fields), I need to display error messaging.
For this reason, I need to use FreeMarker to implement the redirect.
How do I redirect to a new page in a FreeMarker template?
Use the send redirect method. For example:
${ctx.response.sendRedirect("http://google.com")!}
References
WebContext.getResponse
HttpServletResponse.sendRedirect
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With