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
learn-legacy-article-disclaimer-text
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