How do I redirect to a new page in a FreeMarker template?
Asked Answered
P

1

5

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?

Photochronograph answered 19/7, 2019 at 19:2 Comment(0)
P
9

Use the send redirect method. For example:

${ctx.response.sendRedirect("http://google.com")!}

References

Photochronograph answered 19/7, 2019 at 19:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.