2015-04-06 11 views
7

Ho una struttura multi progetto di modulo come:Primavera-boot da classpath

- application (parent module) 
--- boot (web-app) 
----- src/main/resources/templates/layout.html 

---- todo (jar file) 
----- src/main/resources/templates/home.html 

e sul mio regolatore:

@RequestMapping(value = "/home") 
public String home() { 
    return "todo/home"; 
} 

sto ottenendo il messaggio di errore, come di seguito :

Error resolving template "todo/home", template might not exist or 
might not be accessible by any of the configured Template 
Resolvers] 

Esiste la configurazione necessaria per configurare qualcosa appositamente per la primavera per la ricerca di modelli sul percorso di classe?

UPDATE

risolto. Aggiunta seguenti proprietà risolve il mio problema:

spring.thymeleaf.check-template-location=true 
spring.thymeleaf.prefix=classpath:/templates/ 
spring.thymeleaf.suffix=.html 
spring.thymeleaf.mode=LEGACYHTML5 
spring.thymeleaf.encoding=UTF-8 
spring.thymeleaf.content-type=text/html 
spring.thymeleaf.cache=false 
+1

puoiaffiggere l'aggiornamento come una risposta a questa domanda e lo accetto –

risposta

8

Aggiunta seguenti proprietà risolve il mio problema:

spring.thymeleaf.check-template-location=true 
spring.thymeleaf.prefix=classpath:/templates/ 
spring.thymeleaf.suffix=.html 
spring.thymeleaf.mode=LEGACYHTML5 
spring.thymeleaf.encoding=UTF-8 
spring.thymeleaf.content-type=text/html 
spring.thymeleaf.cache=false