Configuration newConfig = new Configuration();
newConfig.setObjectWrapper(wrapper);
newConfig.setSharedVariable("Static", wrapper.getStaticModels());
newConfig.setLocalizedLookup(false);
newConfig.setSharedVariable("StringUtil", new BeanModel(new StringUtil(), wrapper));
newConfig.setTemplateLoader(new FlexibleTemplateLoader());
newConfig.setTemplateExceptionHandler(new FreeMarkerWorker.OFBizTemplateExceptionHandler());
try {
newConfig.setSetting("datetime_format", "yyyy-MM-dd HH:mm:ss.SSS");
newConfig.setSetting("number_format", "0.##########");