freemarker-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Dekany <ddek...@freemail.hu>
Subject Re: TemplateExceptionHandlerType
Date Thu, 07 Apr 2016 06:41:22 GMT
But there's already support for that. If you are using a "properties"
file, try:

     template_exception_handler=RETHROW

or even:

     template_exception_handler=com.example.MyTemplateExceptionHandler

See all the settings that can be set via string-string pairs here:
http://freemarker.org/docs/api/freemarker/template/Configuration.html#setSetting-java.lang.String-java.lang.String-


Thursday, April 7, 2016, 7:57:30 AM, Lalish-Menagh, Trevor wrote:

> Hello FreeMarker Devs,
>
> Which I was working with FreeMarker, I ran into the issue of
> wanting to configure my TemplateExceptionHandler type from a
> standard properties file. Unfortunately, there is no mapping to the
> static TemplateExceptionHandler types to a String equivalent that I could use in properties.
>
> I solved this by creating a TemplateExceptionHandlerType enum with
> a getHandler() method that allows you to get a standard
> TemplateExceptionHandler by String name as follows:
>
>    
> TemplateExceptionHandlerType.valueOf("RETHROW_HANDLER").getHandler());
>
> I have attached my code change, including unit test, as a patch
> file in this email for peer review.
>
> Yours,
> Trevor

-- 
Thanks,
 Daniel Dekany


Mime
View raw message