java


How to force my template resolver to use ClassLoaderTemplateResolver for /mail/* templates


I am using two template resolvers for my Spring Boot Application ServletContextTemplateResolver and ClassLoaderTemplateResolver.
I am using ServletContextTemplateResolver for /WEB-INF/* html templates for my web pages. I will on the other hand, use ClassLoaderTemplateResolver for my /mail/ html templates. Here's the code:
#Bean(name ="templateResolver")
public ServletContextTemplateResolver getTemplateResolver() {
ServletContextTemplateResolver templateResolver = new
ServletContextTemplateResolver();
templateResolver.setPrefix("/WEB-INF/templates/");
templateResolver.setSuffix(".html");
templateResolver.setTemplateMode("XHTML");
templateResolver.setOrder(Integer.valueOf(1));
return templateResolver;
}
#Bean(name ="emailTemplateResolver")
public ClassLoaderTemplateResolver getEmailTemplateResolver() {
ClassLoaderTemplateResolver templateResolver = new
ClassLoaderTemplateResolver();
templateResolver.setOrder(Integer.valueOf(2));
templateResolver.setPrefix("/mail/");
templateResolver.setSuffix(".html");
return templateResolver;
}
It shows the following error when calling the mail template:
Resource resolution by ServletContext with
org.thymeleaf.resourceresolver.ServletContextResourceResolver can only
be performed when context implements org.thymeleaf.context.IWebContext
[current context: org.thymeleaf.context.Context]
How can I force it to use ClassLoaderTemplateResolver for /mail/* templates?

Related Links

JavaFX custom ScrollBar passes event to TableView on scrolling
Use circle image view on android
Detect the leave event of a ImageButton when dragging the RecyclerView Item
android - countdown with decreasing time
Can't name symbolic link to java file other than name of the java file
java pkcs11 slot detection issue with OpenSC if smartcard is removed and inserted again
Recursively deleting a BST
Am i use “AngularJS directives to integrate Google Maps ” or Normal angularjs to build a GPS based tracking web application.?
Does a standard structure of JUnit tests exist? How many assertions per test are usually prefered?
Spring Boot Maven/Gradle plugin: bootRun task generates very long classpath?
Envers - insert actual value of #NotAudited field
Dozer: java.lang.OutOfMemoryError: GC overhead limit exceeded
Spring Data Store Redis - Use Multiple Caches
How to execute a jar file trough java on a different directory [duplicate]
Replace certain words in a sentence
JSF javax.servlet.ServletException: Method not found: class entity

Categories

HOME
log4j
azure-data-factory
reserved
stock
fft
filtering
amortized-analysis
youtube-api-v3
sqlite3
basic
windows-10-universal
quicklook
static-libraries
iron-router
try-catch
netflix
google-static-maps
flux
beyondcompare
google-pagespeed
reverse-proxy
zapier
orleans
sylius
kudan
devops
restful-authentication
java-7
angular2-aot
one-to-many
javacv
cas
selectedindexchanged
publish
windowbuilder
gitignore
bluestacks
yadcf
http-get
accelerate-framework
amazon-kinesis-kpl
mmenu
nssegmentedcontrol
theano.scan
mesos-chronos
particles.js
turbogears
eclipse-gef
btrace
wso2carbon
parentheses
jquery-validate
memory-alignment
iso8601
redundancy
orthogonal
minimization
chord-diagram
angular-strap
file-writing
impresspages
angstrom-linux
actionbardrawertoggle
hill-climbing
master-slave
itextpdf
cartesian-product
simple-framework
fouc
0xdbe
splash
ios9.1
appfabric-cache
processmodel
web-controls
sonarqube5.1.2
typekit
codeigniter-url
angularjs-ng-click
issuu
jubula
phpthumb
system.net.webexception
picturefill
didselectrowatindexpath
java.nio.file
shellexecute
buster.js
pushbackinputstream
mqx
ember-app-kit
cassini-dev
chuck
hosts-file
netbeans-6.9
semantic-diff
coercion
xtype
locationlistener
mongomapper
fixed-width
kdbg
javap
simpletest

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App