随笔分类 -  spring boot

摘要:SpringBoot自动配置流程 1、查看注解@SpringBootApplication,这是一个组合注解,它组合了另一个注解@EnableAutoConfiguration 2、@EnableAutoConfiguration注解导入了一个类AutoConfigurationImportSele 阅读全文
posted @ 2020-06-03 21:43 zhuangrunwei 阅读(307) 评论(0) 推荐(0)
摘要:搭建SpringBoots项目:1、创建一个quickStart的maven项目2、添加springbootparent或使用import范围引入版本依赖3、添加spring-boot-starter-web依赖4、添加@RestController后,spring就知道我们不使用jsp等视图,会自 阅读全文
posted @ 2020-04-11 18:20 zhuangrunwei 阅读(205) 评论(0) 推荐(0)
摘要:1、添加spring boot parent,spring-boot-maven-plugin,spring-boot-starter-web,tomcat-embed-jasper(provided,省略版本号)。2、编写入口类,在入口类可添加@RestController注解,这样入口类就可以支 阅读全文
posted @ 2020-04-11 18:05 zhuangrunwei 阅读(335) 评论(0) 推荐(0)
摘要:junit的使用 1、加入 junit jar包 2、标注@Test注解、调用测试框架方法、调用 httpclient 方法 junit、spring-test 的使用 1、加入 junit 及 spring-test jar包 <dependency> <groupId>junit</groupI 阅读全文
posted @ 2018-11-12 11:09 zhuangrunwei 阅读(571) 评论(0) 推荐(0)
摘要:在Spring security的使用中,为了对方法进行权限控制,通常采用的三个注解,就是@Secured()、@PreAuthorize()、@RolesAllowed()。 示例,修改用户密码必须是ADMIN权限,可以用三种方法: @Secured({"ROLE_ADMIN"}) public 阅读全文
posted @ 2018-03-17 21:04 zhuangrunwei 阅读(950) 评论(0) 推荐(0)
摘要:SpringBoot 之配置server 信息 阅读全文
posted @ 2017-08-16 23:58 zhuangrunwei 阅读(1133) 评论(0) 推荐(0)