Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Freemarker exceptions
Hi, anyone knows if is possible catch any freemarker exception?
For example A simple NullPointerException. Only to show an error message and no the exception stack trace in the view.
Thanks!
Hello,
You can use below code to handle exception in freemarker.
<#attempt>
<em>attempt block</em>
<#recover>
<em>recover block</em>
</#attempt>
For more you can refer https://freemarker.apache.org/docs/ref_directive_attempt.html
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™