springboot
that is the dream
这个作者很懒,什么都没留下…
展开
-
springboot集成Mybatis
pom中配置mysql驱动自定义mysql的版本号<properties> <mysql.version>5.1.9<mysql.version/><properties/>查看mysql版本:select version();然后添加mybatis整合springboot的依赖<dependency> <groupId>org.mybatis.spring.boot&.原创 2021-10-04 15:01:10 · 79 阅读 · 0 评论 -
springboot集成jsp
因为springboot默认使用thymeleaf解析,所以集成jsp要添加依赖,不添加使用不了jsp例:展示jsp页面,内嵌tomcat对jsp页面解析的依赖还需手动指定jsp编译的位置再在application.properties中配置视图解析器代码:方式一@Controllerpublic class IndexController { @RequestMapping("/index") public ModelAndView i...原创 2021-10-04 10:40:29 · 64 阅读 · 0 评论 -
springboot自定义配置映射到对象
将整个文件映射成一个对象,用于自定义配置项比较多的情况使用@Component 和 @ConfigurationProperties 注解,并在configurationproperties中添加prefix用于区分不同类的同名属性(这些属性在application.properties中必须得有前缀)...原创 2021-10-04 09:47:26 · 370 阅读 · 0 评论