Java Code Examples for org.thymeleaf.spring5.templateresolver.SpringResourceTemplateResolver#setSuffix()
The following examples show how to use
org.thymeleaf.spring5.templateresolver.SpringResourceTemplateResolver#setSuffix() .
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: WebConfig.java From Spring5Tutorial with GNU Lesser General Public License v3.0 | 6 votes |
@Bean public ITemplateResolver templateResolver() { // 透過此實例進行相關設定,後續用來建立模版引擎物件 SpringResourceTemplateResolver resolver = new SpringResourceTemplateResolver(); resolver.setApplicationContext(applicationContext); // 開發階段可設定為不快取模版內容,修改模版才能即時反應變更 resolver.setCacheable(false); // 搭配控制器傳回值的前置名稱 resolver.setPrefix("/WEB-INF/templates/"); // 搭配控制器傳回值的後置名稱 resolver.setSuffix(".html"); // HTML 頁面編碼 resolver.setCharacterEncoding("UTF-8"); // 這是一份 HTML 文件 resolver.setTemplateMode(TemplateMode.HTML); return resolver; }
Example 2
Source File: WebConfig.java From Spring5Tutorial with GNU Lesser General Public License v3.0 | 6 votes |
@Bean public ITemplateResolver templateResolver() { // 透過此實例進行相關設定,後續用來建立模版引擎物件 SpringResourceTemplateResolver resolver = new SpringResourceTemplateResolver(); resolver.setApplicationContext(applicationContext); // 開發階段可設定為不快取模版內容,修改模版才能即時反應變更 resolver.setCacheable(false); // 搭配控制器傳回值的前置名稱 resolver.setPrefix("/WEB-INF/templates/"); // 搭配控制器傳回值的後置名稱 resolver.setSuffix(".html"); // HTML 頁面編碼 resolver.setCharacterEncoding("UTF-8"); // 這是一份 HTML 文件 resolver.setTemplateMode(TemplateMode.HTML); return resolver; }
Example 3
Source File: WebConfig.java From Spring5Tutorial with GNU Lesser General Public License v3.0 | 6 votes |
@Bean public ITemplateResolver templateResolver() { // 透過此實例進行相關設定,後續用來建立模版引擎物件 SpringResourceTemplateResolver resolver = new SpringResourceTemplateResolver(); resolver.setApplicationContext(applicationContext); // 開發階段可設定為不快取模版內容,修改模版才能即時反應變更 resolver.setCacheable(false); // 搭配控制器傳回值的前置名稱 resolver.setPrefix("/WEB-INF/templates/"); // 搭配控制器傳回值的後置名稱 resolver.setSuffix(".html"); // HTML 頁面編碼 resolver.setCharacterEncoding("UTF-8"); // 這是一份 HTML 文件 resolver.setTemplateMode(TemplateMode.HTML); return resolver; }
Example 4
Source File: WallRideMailConfiguration.java From wallride with Apache License 2.0 | 5 votes |
@Bean(name = "emailTemplateResolver") public ITemplateResolver emailTemplateResolver() { SpringResourceTemplateResolver resolver = new SpringResourceTemplateResolver(); // resolver.setResourceResolver(wallRideResourceResourceResolver); resolver.setApplicationContext(applicationContext); resolver.setPrefix(environment.getRequiredProperty("spring.thymeleaf.prefix.mail")); resolver.setSuffix(this.properties.getSuffix()); resolver.setTemplateMode(this.properties.getMode()); resolver.setCharacterEncoding(this.properties.getEncoding().name()); resolver.setCacheable(this.properties.isCache()); resolver.setOrder(1); return resolver; }
Example 5
Source File: ApiBootLoggingAdminUiAutoConfiguration.java From api-boot with Apache License 2.0 | 5 votes |
/** * Config thymeleaf Template Resolver * * @return SpringResourceTemplateResolver */ @Bean public SpringResourceTemplateResolver adminTemplateResolver() { SpringResourceTemplateResolver resolver = new SpringResourceTemplateResolver(); resolver.setApplicationContext(this.applicationContext); resolver.setPrefix(this.adminUiProperties.getTemplateLocation()); resolver.setSuffix(TEMPLATE_SUFFIX); resolver.setTemplateMode(TemplateMode.HTML); resolver.setCharacterEncoding(StandardCharsets.UTF_8.name()); resolver.setCacheable(this.adminUiProperties.isCacheTemplates()); resolver.setOrder(10); resolver.setCheckExistence(true); return resolver; }
Example 6
Source File: WebConfig.java From spring-reactive-sample with GNU General Public License v3.0 | 5 votes |
@Bean public SpringResourceTemplateResolver thymeleafTemplateResolver() { final SpringResourceTemplateResolver resolver = new SpringResourceTemplateResolver(); resolver.setApplicationContext(this.ctx); resolver.setPrefix("classpath:/templates/"); resolver.setSuffix(".html"); resolver.setTemplateMode(TemplateMode.HTML); resolver.setCacheable(false); resolver.setCheckExistence(false); return resolver; }
Example 7
Source File: WebConfig.java From spring-reactive-sample with GNU General Public License v3.0 | 5 votes |
@Bean public SpringResourceTemplateResolver thymeleafTemplateResolver() { final SpringResourceTemplateResolver resolver = new SpringResourceTemplateResolver(); resolver.setApplicationContext(this.ctx); resolver.setPrefix("classpath:/templates/"); resolver.setSuffix(".html"); resolver.setTemplateMode(TemplateMode.HTML); resolver.setCacheable(false); resolver.setCheckExistence(false); return resolver; }
Example 8
Source File: WebConfig.java From spring-reactive-sample with GNU General Public License v3.0 | 5 votes |
@Bean public SpringResourceTemplateResolver thymeleafTemplateResolver() { final SpringResourceTemplateResolver resolver = new SpringResourceTemplateResolver(); resolver.setApplicationContext(this.ctx); resolver.setPrefix("classpath:/templates/"); resolver.setSuffix(".html"); resolver.setTemplateMode(TemplateMode.HTML); resolver.setCacheable(false); resolver.setCheckExistence(false); return resolver; }
Example 9
Source File: WebConfig.java From spring-reactive-sample with GNU General Public License v3.0 | 5 votes |
@Bean public SpringResourceTemplateResolver thymeleafTemplateResolver() { final SpringResourceTemplateResolver resolver = new SpringResourceTemplateResolver(); resolver.setApplicationContext(this.ctx); resolver.setPrefix("classpath:/templates/"); resolver.setSuffix(".html"); resolver.setTemplateMode(TemplateMode.HTML); resolver.setCacheable(false); resolver.setCheckExistence(false); return resolver; }
Example 10
Source File: SpringContextConfig.java From Spring-5.0-Cookbook with MIT License | 5 votes |
@Bean(name ="templateResolver") public SpringResourceTemplateResolver getTemplateResolver() { SpringResourceTemplateResolver templateResolver = new SpringResourceTemplateResolver(); templateResolver.setApplicationContext(applicationContext); templateResolver.setPrefix("/WEB-INF/templates/"); templateResolver.setSuffix(".html"); templateResolver.setTemplateMode("XHTML"); return templateResolver; }
Example 11
Source File: SpringWebReactiveConfig.java From Spring-5.0-Cookbook with MIT License | 5 votes |
@Bean(name ="templateResolver") public SpringResourceTemplateResolver getTemplateResolver() { SpringResourceTemplateResolver templateResolver = new SpringResourceTemplateResolver(); templateResolver.setApplicationContext(applicationContext); templateResolver.setPrefix("/WEB-INF/templates/"); templateResolver.setSuffix(".html"); templateResolver.setTemplateMode("XHTML"); return templateResolver; }
Example 12
Source File: SpringContextConfig.java From Spring-5.0-Cookbook with MIT License | 5 votes |
@Bean(name ="templateResolver") public SpringResourceTemplateResolver getTemplateResolver() { SpringResourceTemplateResolver templateResolver = new SpringResourceTemplateResolver(); templateResolver.setApplicationContext(applicationContext); templateResolver.setPrefix("/WEB-INF/templates/"); templateResolver.setSuffix(".html"); templateResolver.setTemplateMode("XHTML"); return templateResolver; }
Example 13
Source File: WebConfig.java From Spring5Tutorial with GNU Lesser General Public License v3.0 | 5 votes |
@Bean public ITemplateResolver templateResolver() { SpringResourceTemplateResolver resolver = new SpringResourceTemplateResolver(); resolver.setApplicationContext(applicationContext); resolver.setCacheable(false); resolver.setPrefix("/WEB-INF/templates/"); resolver.setSuffix(".html"); resolver.setCharacterEncoding("UTF-8"); resolver.setTemplateMode(TemplateMode.HTML); return resolver; }
Example 14
Source File: AdminServerUiAutoConfiguration.java From spring-boot-admin with Apache License 2.0 | 5 votes |
@Bean public SpringResourceTemplateResolver adminTemplateResolver() { SpringResourceTemplateResolver resolver = new SpringResourceTemplateResolver(); resolver.setApplicationContext(this.applicationContext); resolver.setPrefix(this.adminUi.getTemplateLocation()); resolver.setSuffix(".html"); resolver.setTemplateMode(TemplateMode.HTML); resolver.setCharacterEncoding(StandardCharsets.UTF_8.name()); resolver.setCacheable(this.adminUi.isCacheTemplates()); resolver.setOrder(10); resolver.setCheckExistence(true); return resolver; }
Example 15
Source File: WebConfig.java From tutorials with MIT License | 5 votes |
private ITemplateResolver templateResolver() { SpringResourceTemplateResolver resolver = new SpringResourceTemplateResolver(); resolver.setApplicationContext(applicationContext); resolver.setPrefix("/WEB-INF/templates/"); resolver.setSuffix(".html"); resolver.setTemplateMode(TemplateMode.HTML); return resolver; }
Example 16
Source File: WebConfig.java From Spring5Tutorial with GNU Lesser General Public License v3.0 | 5 votes |
@Bean public ITemplateResolver templateResolver() { SpringResourceTemplateResolver resolver = new SpringResourceTemplateResolver(); resolver.setApplicationContext(applicationContext); resolver.setCacheable(false); resolver.setPrefix("/WEB-INF/templates/"); resolver.setSuffix(".html"); resolver.setCharacterEncoding("UTF-8"); resolver.setTemplateMode(TemplateMode.HTML); return resolver; }
Example 17
Source File: WebConfig.java From Spring5Tutorial with GNU Lesser General Public License v3.0 | 5 votes |
@Bean public ITemplateResolver templateResolver() { SpringResourceTemplateResolver resolver = new SpringResourceTemplateResolver(); resolver.setApplicationContext(applicationContext); resolver.setCacheable(false); resolver.setPrefix("/WEB-INF/templates/"); resolver.setSuffix(".html"); resolver.setCharacterEncoding("UTF-8"); resolver.setTemplateMode(TemplateMode.HTML); return resolver; }
Example 18
Source File: WebConfig.java From Spring5Tutorial with GNU Lesser General Public License v3.0 | 5 votes |
@Bean public ITemplateResolver templateResolver() { SpringResourceTemplateResolver resolver = new SpringResourceTemplateResolver(); resolver.setApplicationContext(applicationContext); resolver.setCacheable(false); resolver.setPrefix("/WEB-INF/templates/"); resolver.setSuffix(".html"); resolver.setCharacterEncoding("UTF-8"); resolver.setTemplateMode(TemplateMode.HTML); return resolver; }
Example 19
Source File: WebConfig.java From Spring5Tutorial with GNU Lesser General Public License v3.0 | 5 votes |
@Bean public ITemplateResolver templateResolver() { SpringResourceTemplateResolver resolver = new SpringResourceTemplateResolver(); resolver.setApplicationContext(applicationContext); resolver.setCacheable(false); resolver.setPrefix("/WEB-INF/templates/"); resolver.setSuffix(".html"); resolver.setCharacterEncoding("UTF-8"); resolver.setTemplateMode(TemplateMode.HTML); return resolver; }
Example 20
Source File: WebConfig.java From Spring5Tutorial with GNU Lesser General Public License v3.0 | 5 votes |
@Bean public ITemplateResolver templateResolver() { SpringResourceTemplateResolver resolver = new SpringResourceTemplateResolver(); resolver.setApplicationContext(applicationContext); resolver.setCacheable(false); resolver.setPrefix("/WEB-INF/templates/"); resolver.setSuffix(".html"); resolver.setCharacterEncoding("UTF-8"); resolver.setTemplateMode(TemplateMode.HTML); return resolver; }