Override default freemarker error template
Written By
Giulianna Munoa
How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!
While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.
Legacy Article
You are viewing an article from our legacy "FastTrack"
publication program, made available for informational purposes. Articles
in this program were published without a requirement for independent
editing or verification and are provided"as is" without
guarantee.
Before using any information from this article, independently verify its
suitability for your situation and project.
Issue
- You need to change the default behavior of the default freemarker template showing the entire error code and want to show a different template instead
Resolution
- Even though you’re using the RETHROW option an error message shows whenever the template fails. This happens because the default error templates from the Liferay bundle are showing this exception:
- You can change this behavior by placing your template in the [TOMCAT_HOME]/webapps/ROOT/WEB-INF/classes directory
- After successfully locating the template, change the following properties in the portal-ext.properties file to match the location and name of your template
portlet.display.templates.error[ftl]=[TOMCAT_HOME]/webapps/ROOT/WEB-INF/classes/portlet_display_template_error.ftl
portlet.display.templates.error[vm]=[TOMCAT_HOME]/webapps/ROOT/WEB-INF/classes/portlet_display_template_error.vm
- Restart your Liferay bundle and check.
Additional information
Did this article resolve your issue ?