Get the App
SLTechnology News&Howtos  ›  Development  › 

How to shield the error message of the foreground FreeMarker template

Shulou Source: shulou.com Published: 2022-06-02 01:31:19 10月05日 Update

This article mainly explains "how to shield the error message of the foreground FreeMarker template". The content of the explanation in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought slowly and deeply, and study and learn "how to shield the error message of the foreground FreeMarker template".

Error messages for templates are usually not shielded. The error message of the foreground FreeMarker template will accurately locate the location of the template file where the error occurred, the number of lines of error code and the cause of the error, which is very conducive to the troubleshooting of the template. If you block the template error message, it will make template debugging difficult or even impossible to start.

If shielding is needed in actual use, you can modify the configuration of FreeMarker in / WEB-INF/classes/conf/context.xml:

Square_bracket... Rethrow

With the rethrow configuration, template exceptions will be handled as system exceptions.

The display page of the system exception is in the / WEB-INF/views/error directory.

Thank you for your reading, the above is the content of "how to shield the error message of the foreground FreeMarker template". After the study of this article, I believe you have a deeper understanding of how to shield the error message of the foreground FreeMarker template. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Templates errors information foreground learning content system problems configuration difficulties code location reason reality that is ideas situations files articles no way to start Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi macOS MySQL OPPO Reno Linux