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
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
Post a Comment