Bean的作用域(scope)
- 默认的 singleton单一实例
- prototype 创建新的对象
- request 每个请求创建一个新的对象
- session
依赖注入(setter+注入的bean)
右键-source-genarate getter setter
Name是Person类中的实例 ref是上边的bean中的fandian
包扫描
Bean的作用域(scope)
依赖注入(setter+注入的bean)
右键-source-genarate getter setter
Name是Person类中的实例 ref是上边的bean中的fandian
包扫描