8战魂5无双8的gravatar头像
8战魂5无双8 2019-11-03 01:28:48
maven的ssm+thymeleaf踩得坑。

1、样式问题,和springboot不一样的地方在于,你的springmvc.xml中,要添加<mvc:default-servlet-handler/>maven的ssm+thymeleaf踩得坑。

其次,webapp下的顺序,必须和我下面的图一样maven的ssm+thymeleaf踩得坑。

web-infn下是templates也就是模板引擎,thymeleaf。否则你就会抛出一个奇葩的问题。这个问题,和@RestControoler或者@Controoler这两个没关系,和返回值json的也没有关系。项目静态文件夹下的顺序

maven的ssm+thymeleaf踩得坑。

否则就会抛出这个问题:

An error happened during template parsing (template: "ServletContext resource [/templates/index.html]")

就会抛出这个异常,这个异常和返回 json的没有任何关系。百度上的答案真是扯淡。这个要自己去琢磨。

 


打赏

已有1人打赏

最代码官方的gravatar头像
最近浏览
随风而逝90  LV2 2021年12月28日
iipoia  LV2 2021年4月23日
wangdongtai  LV31 2021年2月6日
lr1643200306 2020年12月9日
暂无贡献等级
sky-123 2020年6月11日
暂无贡献等级
随便取个名字_哈哈  LV26 2020年6月7日
H294590501 2020年5月2日
暂无贡献等级
fashion1314  LV5 2020年4月25日
郑清华  LV1 2020年4月11日
娱乐人  LV3 2020年2月26日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友