Spring
spring框架相关知识点记录
如月之恒-
这个作者很懒,什么都没留下…
展开
-
@RequestParam与@RequestBody对比
handler method 参数绑定常用的注解,我们根据他们处理的Request的不同内容部分分为四类:(主要讲解常用类型)处理requet uri 部分(这里指uri template中variable,不含queryString部分)的注解: @PathVariable;处理request header部分的注解: @RequestHeader, @CookieValue;处...原创 2019-01-11 11:41:07 · 14429 阅读 · 5 评论 -
spring boot注解实现权限控制
1、自定义注解Target(ElementType.METHOD)@Retention(RetentionPolicy.RUNTIME)@Documentedpublic @interface RoleCheck { String[] roles() default {};}2、注解的实现@Servicepublic class RoleCheckInterceptor ...原创 2018-12-25 11:30:53 · 3712 阅读 · 1 评论 -
springboot 实现自定义注解
1、定义一个注解@Target(ElementType.METHOD)@Retention(RetentionPolicy.RUNTIME)@Documentedpublic @interface Test {}注意:@TargetElementType.TYPE:接口、类、枚举、注解ElementType.FIELD:字段、枚举的常量ElementType.METHO...原创 2018-12-25 11:11:17 · 1184 阅读 · 0 评论 -
springboot获取项目项目中的文件
https://stackoverflow.com/questions/25869428/classpath-resource-not-found-when-running-as-jarString data = "";ClassPathResource cpr = new ClassPathResource("static/file.txt");try { byte[] bdata...转载 2018-12-03 17:42:37 · 3638 阅读 · 0 评论