org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver Java Examples
The following examples show how to use
org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AccountControllerTest.java From molgenis with GNU Lesser General Public License v3.0 | 6 votes |
@BeforeEach void setUp() { FreeMarkerViewResolver freeMarkerViewResolver = new FreeMarkerViewResolver(); freeMarkerViewResolver.setSuffix(".ftl"); mockMvc = MockMvcBuilders.standaloneSetup(authenticationController) .setMessageConverters( new FormHttpMessageConverter(), new GsonHttpMessageConverter(new Gson())) .build(); reset(authenticationSettings); reset(reCaptchaService); reset(appSettings); when(reCaptchaService.validate("validCaptcha")).thenReturn(true); reset(accountService); // mocks in the config class are not resetted after each test }
Example #2
Source File: MetadataManagerControllerTest.java From molgenis with GNU Lesser General Public License v3.0 | 6 votes |
@BeforeEach void beforeMethod() { MockitoAnnotations.initMocks(this); FreeMarkerViewResolver freeMarkerViewResolver = new FreeMarkerViewResolver(); freeMarkerViewResolver.setSuffix(".ftl"); when(menuReaderService.findMenuItemPath(MetadataManagerController.METADATA_MANAGER)) .thenReturn("/test/path"); when(appSettings.getLanguageCode()).thenReturn("nl"); User user = mock(User.class); when(userAccountService.getCurrentUser()).thenReturn(user); MetadataManagerController metadataEditorController = new MetadataManagerController(menuReaderService, metadataManagerService); mockMvc = MockMvcBuilders.standaloneSetup(metadataEditorController) .setLocaleResolver(localeResolver) .setMessageConverters(new FormHttpMessageConverter(), gsonHttpMessageConverter) .build(); }
Example #3
Source File: WebFtlsContextConfig.java From onetwo with Apache License 2.0 | 6 votes |
@Bean @ConditionalOnMissingBean({FreeMarkerConfig.class, FreeMarkerViewResolver.class}) public FreeMarkerConfigurer freeMarkerConfigurer() { PluginFreeMarkerConfigurer configurer = new PluginFreeMarkerConfigurer(); applyProperties(configurer); String[] paths = this.properties.getTemplateLoaderPath(); // paths = ArrayUtils.add(paths, WEBFTLS_PATH); configurer.setTemplateLoaderPaths(paths); List<WithAnnotationBeanData<FreeMarkerViewTools>> tools = SpringUtils.getBeansWithAnnotation(applicationContext, FreeMarkerViewTools.class); tools.forEach(t->{ String name = t.getAnnotation().value(); if(StringUtils.isBlank(name)){ name = t.getBean().getClass().getSimpleName(); } configurer.setFreemarkerVariable(name, t.getBean()); logger.info("registered FreeMarkerViewTools : {}", name); }); return configurer; }
Example #4
Source File: SpringContextConfig.java From Spring-5.0-Cookbook with MIT License | 5 votes |
@Bean(name = "viewResolverFTL") public FreeMarkerViewResolver getViewResolverFtl() { FreeMarkerViewResolver viewResolver = new FreeMarkerViewResolver(); viewResolver.setPrefix(""); viewResolver.setSuffix(".ftl"); viewResolver.setOrder(1); return viewResolver; }
Example #5
Source File: SpringWebConfig.java From tutorials with MIT License | 5 votes |
@Bean public FreeMarkerViewResolver freemarkerViewResolver() { FreeMarkerViewResolver resolver = new FreeMarkerViewResolver(); resolver.setCache(true); resolver.setPrefix(""); resolver.setSuffix(".ftl"); return resolver; }
Example #6
Source File: FreemarkerConfiguration.java From tutorials with MIT License | 5 votes |
@Bean public FreeMarkerViewResolver freemarkerViewResolver() { FreeMarkerViewResolver resolver = new FreeMarkerViewResolver(); resolver.setCache(true); resolver.setPrefix(""); resolver.setSuffix(".ftl"); return resolver; }
Example #7
Source File: EmailConfiguration.java From tutorials with MIT License | 5 votes |
@Bean public FreeMarkerViewResolver freemarkerViewResolver() { FreeMarkerViewResolver resolver = new FreeMarkerViewResolver(); resolver.setCache(true); resolver.setPrefix(""); resolver.setSuffix(".ftl"); return resolver; }
Example #8
Source File: MolgenisWebAppConfig.java From molgenis with GNU Lesser General Public License v3.0 | 5 votes |
/** Enable spring freemarker viewresolver. All freemarker template names should end with '.ftl' */ @Bean public ViewResolver viewResolver() { FreeMarkerViewResolver resolver = new FreeMarkerViewResolver(); resolver.setCache(true); resolver.setSuffix(".ftl"); resolver.setContentType("text/html;charset=UTF-8"); return resolver; }
Example #9
Source File: FreeMarkerAutoconfigure.java From cms with Apache License 2.0 | 5 votes |
@Bean public ViewResolver viewResolver(FreeMarkerViewResolver resolver) { // resolver.setCache(true); // resolver.setPrefix(""); // resolver.setSuffix(".ftl"); // resolver.setContentType("text/html; charset=UTF-8"); resolver.setViewClass(DefaultFreemarkerView.class); return resolver; }
Example #10
Source File: SpringWebReactiveConfig.java From Spring-5.0-Cookbook with MIT License | 5 votes |
@Bean(name = "viewResolverFTL") public FreeMarkerViewResolver getViewResolverFtl() { FreeMarkerViewResolver viewResolver = new FreeMarkerViewResolver(); viewResolver.setPrefix(""); viewResolver.setSuffix(".ftl"); viewResolver.setOrder(1); return viewResolver; }
Example #11
Source File: SpringContextConfig.java From Spring-5.0-Cookbook with MIT License | 5 votes |
@Bean(name = "viewResolverFTL") public FreeMarkerViewResolver getViewResolverFtl() { FreeMarkerViewResolver viewResolver = new FreeMarkerViewResolver(); viewResolver.setPrefix(""); viewResolver.setSuffix(".ftl"); viewResolver.setOrder(1); return viewResolver; }
Example #12
Source File: WebMvcAutoConfiguration.java From halo with GNU General Public License v3.0 | 5 votes |
/** * Configuring view resolver * * @param registry registry */ @Override public void configureViewResolvers(ViewResolverRegistry registry) { FreeMarkerViewResolver resolver = new FreeMarkerViewResolver(); resolver.setAllowRequestOverride(false); resolver.setCache(false); resolver.setExposeRequestAttributes(false); resolver.setExposeSessionAttributes(false); resolver.setExposeSpringMacroHelpers(true); resolver.setSuffix(HaloConst.SUFFIX_FTL); resolver.setContentType("text/html; charset=UTF-8"); registry.viewResolver(resolver); }
Example #13
Source File: GlobalConfig.java From pacbot with Apache License 2.0 | 5 votes |
@Bean public ViewResolver viewResolver() { FreeMarkerViewResolver resolver = new FreeMarkerViewResolver(); resolver.setCache(true); resolver.setPrefix(""); resolver.setSuffix(".html"); resolver.setContentType("text/html; charset=UTF-8"); return resolver; }
Example #14
Source File: FreeMarkerViewConfiguration.java From apm-agent-java with Apache License 2.0 | 5 votes |
@Bean public FreeMarkerViewResolver freemarkerViewResolver() { FreeMarkerViewResolver resolver = new FreeMarkerViewResolver(); resolver.setCache(true); resolver.setPrefix(""); resolver.setSuffix(".ftl"); return resolver; }
Example #15
Source File: ViewResolverRegistry.java From spring-analysis-note with MIT License | 4 votes |
public FreeMarkerRegistration() { super(new FreeMarkerViewResolver()); getViewResolver().setSuffix(".ftl"); }
Example #16
Source File: ViewResolverRegistry.java From lams with GNU General Public License v2.0 | 4 votes |
public FreeMarkerRegistration() { super(new FreeMarkerViewResolver()); getViewResolver().setSuffix(".ftl"); }
Example #17
Source File: ViewResolverRegistry.java From spring4-understanding with Apache License 2.0 | 4 votes |
private FreeMarkerRegistration() { super(new FreeMarkerViewResolver()); getViewResolver().setSuffix(".ftl"); }
Example #18
Source File: ViewResolutionIntegrationTests.java From spring4-understanding with Apache License 2.0 | 4 votes |
@Bean public FreeMarkerViewResolver freeMarkerViewResolver() { FreeMarkerViewResolver viewResolver = new FreeMarkerViewResolver(); viewResolver.setSuffix(".ftl"); return viewResolver; }
Example #19
Source File: ViewResolverRegistryTests.java From spring4-understanding with Apache License 2.0 | 4 votes |
@Test public void freeMarker() { this.registry.freeMarker().prefix("/").suffix(".fmt").cache(false); FreeMarkerViewResolver resolver = checkAndGetResolver(FreeMarkerViewResolver.class); checkPropertyValues(resolver, "prefix", "/", "suffix", ".fmt", "cacheLimit", 0); }
Example #20
Source File: ViewResolverRegistryTests.java From spring4-understanding with Apache License 2.0 | 4 votes |
@Test public void freeMarkerDefaultValues() { this.registry.freeMarker(); FreeMarkerViewResolver resolver = checkAndGetResolver(FreeMarkerViewResolver.class); checkPropertyValues(resolver, "prefix", "", "suffix", ".ftl"); }
Example #21
Source File: ViewResolverRegistryTests.java From java-technology-stack with MIT License | 4 votes |
@Test public void freeMarkerDefaultValues() { this.registry.freeMarker(); FreeMarkerViewResolver resolver = checkAndGetResolver(FreeMarkerViewResolver.class); checkPropertyValues(resolver, "prefix", "", "suffix", ".ftl"); }
Example #22
Source File: ViewResolverRegistryTests.java From java-technology-stack with MIT License | 4 votes |
@Test public void freeMarker() { this.registry.freeMarker().prefix("/").suffix(".fmt").cache(false); FreeMarkerViewResolver resolver = checkAndGetResolver(FreeMarkerViewResolver.class); checkPropertyValues(resolver, "prefix", "/", "suffix", ".fmt", "cacheLimit", 0); }
Example #23
Source File: ViewResolutionIntegrationTests.java From java-technology-stack with MIT License | 4 votes |
@Bean public FreeMarkerViewResolver freeMarkerViewResolver() { return new FreeMarkerViewResolver("", ".ftl"); }
Example #24
Source File: ViewResolverRegistry.java From java-technology-stack with MIT License | 4 votes |
public FreeMarkerRegistration() { super(new FreeMarkerViewResolver()); getViewResolver().setSuffix(".ftl"); }
Example #25
Source File: ViewResolverRegistryTests.java From spring-analysis-note with MIT License | 4 votes |
@Test public void freeMarkerDefaultValues() { this.registry.freeMarker(); FreeMarkerViewResolver resolver = checkAndGetResolver(FreeMarkerViewResolver.class); checkPropertyValues(resolver, "prefix", "", "suffix", ".ftl"); }
Example #26
Source File: ViewResolverRegistryTests.java From spring-analysis-note with MIT License | 4 votes |
@Test public void freeMarker() { this.registry.freeMarker().prefix("/").suffix(".fmt").cache(false); FreeMarkerViewResolver resolver = checkAndGetResolver(FreeMarkerViewResolver.class); checkPropertyValues(resolver, "prefix", "/", "suffix", ".fmt", "cacheLimit", 0); }
Example #27
Source File: ViewResolutionIntegrationTests.java From spring-analysis-note with MIT License | 4 votes |
@Bean public FreeMarkerViewResolver freeMarkerViewResolver() { return new FreeMarkerViewResolver("", ".ftl"); }