Override default freemarker error template
Written By
Giulianna Munoa
How To articles are not official guidelines or officially
supporteddocumentation. They are community-contributed content and may
not alwaysreflect the latest updates to Liferay DXP. We welcome your
feedback toimprove How to articles!
While we make every effort to ensure this Knowledge Base is accurate,
itmay not always reflect the most recent updates or official
guidelines.We appreciate your understanding and encourage you to reach
out with anyfeedback or concerns.
Legacy Article
You are viewing an article from our legacy
"FastTrack"publication program, made available for
informational purposes. Articlesin this program were published without a
requirement for independentediting or verification and are provided
"as is" withoutguarantee.
Before using any information from this article, independently verify
itssuitability 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 ?