因为在扫描Handler方法时,只会在SpringMvc容器中去查找bean 定义,不会查找父容器
因此,如果把controller放到Spring容器中直接报404。
而doGetBean方法是会查找父容器的,所以controller中可以注入父容器中的service和dao
因为在扫描Handler方法时,只会在SpringMvc容器中去查找bean 定义,不会查找父容器
因此,如果把controller放到Spring容器中直接报404。
而doGetBean方法是会查找父容器的,所以controller中可以注入父容器中的service和dao
暂无评论
2023-12-22
2023-12-19
2023-12-19
2023-12-19
2023-12-19
2023-12-15
2023-12-15
2023-12-15
2024-05-20
2024-05-20
2024-05-18
2024-05-18
2024-05-18
2024-05-18
2024-05-18
2024-05-18
2024-05-18
2024-05-18
2024-05-18
2024-05-18
2024-05-18
2024-05-18
2024-05-17
2024-05-17
2024-05-17
2024-05-17
2024-05-17