當前位置: 首頁>>代碼示例>>Java>>正文


Java FreeMarkerConfigurer.setPreferFileSystemAccess方法代碼示例

本文整理匯總了Java中org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer.setPreferFileSystemAccess方法的典型用法代碼示例。如果您正苦於以下問題:Java FreeMarkerConfigurer.setPreferFileSystemAccess方法的具體用法?Java FreeMarkerConfigurer.setPreferFileSystemAccess怎麽用?Java FreeMarkerConfigurer.setPreferFileSystemAccess使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer的用法示例。


在下文中一共展示了FreeMarkerConfigurer.setPreferFileSystemAccess方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: freemarkerConfig

import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer; //導入方法依賴的package包/類
@Bean
public FreeMarkerConfigurer freemarkerConfig() {
    FreeMarkerConfigurer freeMarkerConfigurer = new FreeMarkerConfigurer();
    freeMarkerConfigurer.setTemplateLoaderPath("/freemarker/view");
    freeMarkerConfigurer.setDefaultEncoding("UTF-8");
    freeMarkerConfigurer.setPreferFileSystemAccess(false);
    return freeMarkerConfigurer;
}
 
開發者ID:opensingular,項目名稱:singular-server,代碼行數:9,代碼來源:ServerStudioWebMVCConfig.java

示例2: freeMarkerConfigurer

import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer; //導入方法依賴的package包/類
/**
 * Overrides Spring Boot's {@link FreeMarkerAutoConfiguration} to prefer using a
 * {@link SpringTemplateLoader} instead of the file system. This corrects an issue
 * where Spring Boot may use an empty 'templates' file resource to resolve templates
 * instead of the packaged Hystrix classpath templates.
 * @return FreeMarker configuration
 */
@Bean
public FreeMarkerConfigurer freeMarkerConfigurer() {
	FreeMarkerConfigurer configurer = new FreeMarkerConfigurer();
	configurer.setTemplateLoaderPaths(DEFAULT_TEMPLATE_LOADER_PATH);
	configurer.setDefaultEncoding(DEFAULT_CHARSET);
	configurer.setPreferFileSystemAccess(false);
	return configurer;
}
 
開發者ID:spring-cloud,項目名稱:spring-cloud-netflix,代碼行數:16,代碼來源:HystrixDashboardConfiguration.java

示例3: freeMarkerConfigurer

import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer; //導入方法依賴的package包/類
@Bean
public FreeMarkerConfigurer freeMarkerConfigurer () {
  FreeMarkerConfigurer configurer = new FreeMarkerConfigurer ();
  configurer.setTemplateLoaderPath ("classpath:");
  configurer.setPreferFileSystemAccess (false);
  return configurer;
}
 
開發者ID:dfci-cccb,項目名稱:mev,代碼行數:8,代碼來源:ViewResolverConfiguration.java

示例4: freeMarkerConfigurer

import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer; //導入方法依賴的package包/類
/**
 * Configure freemarker. All freemarker templates should be on the classpath in a package called 'freemarker'
 */
@Bean
public FreeMarkerConfigurer freeMarkerConfigurer()
{
	FreeMarkerConfigurer result = new FreeMarkerConfigurer()
	{
		@Override
		protected void postProcessConfiguration(Configuration config) throws IOException, TemplateException
		{
			config.setObjectWrapper(new MolgenisFreemarkerObjectWrapper(VERSION_2_3_23));
		}
	};
	result.setPreferFileSystemAccess(false);
	result.setTemplateLoaderPath("classpath:/templates/");
	result.setDefaultEncoding("UTF-8");
	Properties freemarkerSettings = new Properties();
	freemarkerSettings.setProperty(Configuration.LOCALIZED_LOOKUP_KEY, Boolean.FALSE.toString());
	result.setFreemarkerSettings(freemarkerSettings);
	Map<String, Object> freemarkerVariables = Maps.newHashMap();
	freemarkerVariables.put("limit", new LimitMethod());
	freemarkerVariables.put("hasPermission", new HasPermissionDirective(permissionService));
	freemarkerVariables.put("notHasPermission", new NotHasPermissionDirective(permissionService));
	addFreemarkerVariables(freemarkerVariables);

	result.setFreemarkerVariables(freemarkerVariables);

	return result;
}
 
開發者ID:molgenis,項目名稱:molgenis,代碼行數:31,代碼來源:MolgenisWebAppConfig.java


注:本文中的org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer.setPreferFileSystemAccess方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。