现在动静分离很多,静态页面几乎都还存在浏览器,
这里说的是用thymeleaf渲染前台数据时,后台直接把整个HTML页面代码缓存到redis中,请求直接返回整个页面
SpringWebContext ctx = new SpringWebContext(request,response,
request.getServletContext(),request.getLocale(), model.asMap(), applicationContext );
html = thymeleafViewResolver.getTemplateEngine().process("login", ctx);
这么一段话,主要是用到了ThymeleafViewRresolver,集成thymeleaf直接注入就好
最近在整理一些资源工具,放在网站分享 http://tools.maqway.com
欢迎关注公众号:麻雀唯伊 , 不定时更新资源文章,生活优惠,或许有你想看的