Last active
May 10, 2020 11:31
-
-
Save AnjaliManhas/01695ae2af56b69cee0becc1f5c63775 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import freemarker.template.Configuration; | |
import freemarker.template.TemplateExceptionHandler; | |
import java.io.File; | |
import java.io.IOException; | |
public class TemplateConfigurationContext { | |
private static Configuration configuration = new Configuration(Configuration.VERSION_2_3_27); | |
public static Configuration getConfiguration() { | |
try { | |
configuration.setDirectoryForTemplateLoading(new File("C:\\Users\\HP\\IdeaProjects\\myRestProject\\src\\HelloWorld")); | |
configuration.setDefaultEncoding("UTF-8"); | |
configuration.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER); | |
configuration.setLogTemplateExceptions(false); | |
configuration.setWrapUncheckedExceptions(true); | |
} catch (IOException e) { | |
e.printStackTrace(); | |
} | |
return configuration; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment