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

Can I use a program via java? [closed]
Calling method when i close the dialog box of Spinner in dialog mode
JoinFormula fails with More than one row with the given identifier was found
Java - Download file with NIO - multiple connections
jax-ws spring integration - can't deploy on wildfly using wsdlLocation annotation in web service implementation class
Unit testing in Apache Storm - timeout with BaseRichBolt but not with BaseBasicBolt
JTable based on a list of Objects, like TableView's items list
Use custom supplied .jar files when building with gradle (not repository)? [duplicate]
Display images through aray in Android Studio
Reuse an stream in esper in several queries
How does a multi-threaded web server affect a Clojure program?
Silenium webdriver using Java: Exception in thread “main” org.openqa.selenium.ElementNotVisibleException:
How to apply side borders to table columns till footer
Java Create SOAP Consumer For Custom SOAP Envelop
is there any way where I can find out when was the last time a String/Integer was accessed in Java?
Must constructors of child classes mirror their parent's constructor exactly in java? [duplicate]

Categories

HOME
log4j
jdo
isabelle
react-virtualized
stock
onedrive
paw-app
serverspec
uber-api
basic
quickbooks
telephony
seaborn
angular-ui
footer
contextmenu
shared-hosting
visjs
orleans
functional-testing
microsoft-r
claims-based-identity
autosys
trading
p-value
tdd
bootstrap-duallistbox
uninstall
atlassian-crucible
bluestacks
google-sites-2016
jspresso
http-get
android-ble
plsql-psp
suricata
vxworks
libraries
c11
unobtrusive-validation
reportingservices-2005
firebase-admin
sas-jmp
scorm
jsch
qsslsocket
hendrix
powercli
integrity
knockout-components
snmptrapd
color-profile
dwscript
parallel-data-warehouse
radtreelist
database-optimization
bstr
prettytensor
master-slave
packagist
fadeout
oauth2client
ptrace
hsv
wso2cloud
google-places
cyclomatic-complexity
mutation-observers
wyam
dukescript
tableau-online
interrupted-exception
method-parameters
processmodel
streambase
python-green
qpainter
coldbox
google-style-guide
applescript-objc
titanium-modules
mesa
typeof
phpthumb
viadeo
inbox
padarn
selected
mhtml
dsn
nsmanagedobject
reddot
pendrive
sudzc
gamequery
microsoft-virtualization
avatar
privilege
ubuntu-9.04

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