java - Mustache prefix:classpath:/templates/ throwing 404 -


i have strange problem here. following configuration working fine in eclipse when run eclipse. when build jar , run throwing 404 following request mapping. further debug gave me error null modelandview found

i have configured mustache in application.yml follows

spring:      profiles:     active: dev  mustache:      prefix:classpath:/templates/      suffix:.html 

i have following folder structure

enter image description here

my controller

@controller public class maincontroller {      @requestmapping("/home1")     modelandview home1() {           modelandview modelandview =new modelandview();           map<string,object> modelobjects = new linkedhashmap<string,object>();           modelandview.addobject("modelobjects", modelobjects);           modelandview.setviewname("/home");         return modelandview;     } } 

i'm stupidest man in world.

modelandview.setviewname("/home"); should not have / @ beginning. somehow it's working fine when run target, not in jar.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -