
spring
氡佴
这个作者很懒,什么都没留下…
展开
-
springboot注意事项
动态切换java -jar spring-boot-application-properties-sample-1.0.0.jar --spring.profiles.active=devargs = new String[]{“KAFKA”,“NORMAL”,“KAFKA”,"****","–spring.profiles.active=dev"};Springboot @value不能给...原创 2020-03-20 11:04:50 · 79 阅读 · 0 评论 -
spring学习心得
spring学习的方面总的分为以下几个方面: 一.ioc容器 二.aop面向切面的编程 三.spring对事务的管理spring配置文件放在类路径下,可直接使用 ApplicationContext applicationContext=new ClassPathXmlApplicationContext(“springaop.xml”); 其中applicationcontext是原创 2018-02-03 19:45:16 · 1640 阅读 · 1 评论 -
SpringBoot-异常处理器
定义自己的异常,需要继承runtimeExceptionpublic class GlobalException extends RuntimeException{ private static final long serialVersionUID = 1L; private CodeMsg cm; public GlobalException(CodeMsg ...原创 2018-07-05 10:45:21 · 300 阅读 · 0 评论 -
自定义注解
1.需要在包下新建一个 annotention的类 2.需要在类上加两个注解 @Target(METHOD) 是作用的目标,这里我们是基于方法的 如果是基于类或接口的那么就需要用@Target(ElementType.TYPE)@Retention(RUNTIME)@Target(METHOD)public @interface AccessLimit { int secon...原创 2018-07-14 10:36:25 · 401 阅读 · 0 评论