php网站开发案例教程 dvd,宁波h5模板建站,网站更多分享怎么做,wordpress网站变灰springboot 成功创建了后#xff0c;继续写一下跳转到html页面的方法, 这里我把 jsp和html 分开两篇文章。然后再写一个两种方式整合的这篇 是跳转到html文件的1创建目录结果和html文件 2配置return 返回模版 3.UserController.java代码如下#xff0c;这里就直接使用上…springboot 成功创建了后继续写一下跳转到html页面的方法, 这里我把 jsp和html 分开两篇文章。然后再写一个两种方式整合的这篇 是跳转到html文件的1创建目录结果和html文件 2配置return 返回模版 3.UserController.java代码如下这里就直接使用上次创建的查询方法RequestMapping(value /testHtml, produces application/json;charsetUTF-8, method {RequestMethod.POST, RequestMethod.GET})public String testHtml(Model m, HttpServletRequest request, HttpServletResponse response){ List listuserService.userQueryAll(); request.setAttribute(list,list); log.info(进入了testHtml方法); return views/testHtml; } 4.application.yml 文件 配置 thymeleaf 模版参数 spring:dataSource:type: com.alibaba.druid.pool.DruidDataSourceurl: jdbc:mysql://localhost:3306/db-test?useUnicodetruecharacterEncodingutf8tinyInt1isBitfalseusesslfalseusername: rootpassword: 123456driverClassName: com.mysql.jdbc.Driverthymeleaf:#清除缓存cache: falsemode: LEGACYHTML5 #非严格模式prefix: /WEB-INF/ #默认 classpath:/templates/suffix: .htmlservlet:content-type: text/html 5. pom.xml 文件加入thymeleaf 架包org.springframework.bootspring-boot-starter-thymeleafnet.sourceforge.nekohtmlnekohtml1.9.22 6. html页面这里我为了方便事先引入了jQuery 并且直接使用了thymeleaf 模版来接收数据也是第一次用。Title 7. Project Structure里面 这个一般是默认配置好了的如果没有就要加上哦 就这样启动就行了 效果图如下