1.返回ModelAndView对象(.jsp) controller代码: package controller; import java.util.List; import javax.annotation.Resource; import model.Comment; import org.s ...
分类:
编程语言 时间:
2020-04-21 13:07:02
阅读次数:
64
文章首发我的博客,欢迎访问:https://blog.itzhouq.cn/annotation reflection 最近又回顾了一下 Java 中的注解和反射知识点,注解在日常开发中使用很多,但是反射比较少。值得注意的是 Java 的各种框架底层源码中大量使用了注解和反射,阅读源码,这些是基本功 ...
分类:
编程语言 时间:
2020-04-19 13:04:47
阅读次数:
59
切面上的切入点@Pointcut的参数: execution:用于匹配符合的方法; @annotation:用于匹配持有指定注解的方法; 这两个常用的 切入点指示符用来指示切入点表达式目的,,在Spring AOP中目前只有执行方法这一个连接点,Spring AOP支持的AspectJ切入点指示符如 ...
分类:
编程语言 时间:
2020-04-19 12:35:30
阅读次数:
70
前后端开发学习中,vue里面需要跨域访问后台数据 可在springboot后台里面添加个配置类即可: package com.springboottest.config; import org.springframework.beans.factory.annotation.Configurable ...
分类:
编程语言 时间:
2020-04-12 14:56:49
阅读次数:
91
1、bean基于Annotation装配 2、@Resource和@Autowired区别补充: i. @Resource是javaEE中的方法,@Autowired是spring中的方法 ii. 不能在普通类(不在IOC容器中的类)中使用@Resource和@Autowired iii. @Aut ...
分类:
其他好文 时间:
2020-04-11 19:01:17
阅读次数:
77
1.编写一个过滤器: import lombok.extern.slf4j.Slf4j; import javax.servlet.*; import javax.servlet.annotation.WebFilter; import javax.servlet.http.HttpServletR ...
分类:
编程语言 时间:
2020-04-11 18:53:46
阅读次数:
81
一、相同点: @Autowired和@Resource作用基本相同,都是用于自动装配bean对象。都可以写在字段上,或写在setter方法上。 二、不同点: 1.出处不同 @Autowired(Spring注解,org.springframework.beans.factory.annotation ...
分类:
编程语言 时间:
2020-04-11 18:45:13
阅读次数:
74
错误信息: - JSR-250 'javax.annotation.ManagedBean' found and supported for component scanning - Context initialization failed org.springframework.beans.fa ...
分类:
编程语言 时间:
2020-04-07 12:55:07
阅读次数:
70
Zuul的上传 1、构建一个上传类 import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import or ...
分类:
编程语言 时间:
2020-04-07 00:27:31
阅读次数:
101
1.引入依赖 ` 2.idea 的设置 在idea里设置annotation processors,如下图所示 设置完成后,重新编译项目,会在对应的目录生成实体对象的元模型,类似与User_ ...
分类:
Web程序 时间:
2020-04-06 20:38:47
阅读次数:
172