当前位置:网站首页>No qualifying bean of type question
No qualifying bean of type question
2022-07-31 03:33:00 【UlricaQ】
Article table of contents
No qualifying bean of type problem solving ideas
To solve the problem of No qualifying bean of type, there are currently two reasons for the error:
- Annotations
- Configuration (scanning packages, nacos, class names, etc.)
1. Comments
- Check if the annotations corresponding to controller, service and mapper are correct
- Such as: @Controller @Service @Component @Repository
2. Configuration
1. Configure whether nacos is used, and you need to configure database information, etc.
2. Whether the scan package is used
or use @MapperScan(value="com.*** ")
Annotation Extension
- what: special tag in code
- where: can be placed on a method or a class
1. How does the front-end code link use annotations?
- If the annotation is on the method, you can write the annotation of the method in the link
- If the annotation is on the class, you need to write the annotation of the class + method in the link
2. Annotation attribute:
- path: Specifies the requested URL
- (commonly used) value has the same function as path, you can add a path, use value can be omitted, just write the path directly
- (commonly used) method: specify the request method of this method
- headers: Specify conditions to limit request headers-
- params: conditions for restricting request parameters
– the key and value are the same
– case 1: only limit the parameters passed, not what the parameters are specific
– case 2: the parameters must be consistent
3. Common Notes
@RequestParam
- Role: Assign the parameter with the specified name in the request to the formal parameter in the controller
- Attribute:
–value: parameter name
–required: whether this parameter must be filled in - Example
@RequestBody
- Role: used to get the content of the request body
- Attribute: required
- Scope: Asynchronous (used when asynchronous)
- Example
@PathVariable
- Function: placeholder for binding url
- Benefits: restful programming style
- The original way – add the root path to each path
- restful method: use get, post, put to distinguish the path
–localhost:8080/user/10 get——this is the http request indicating that the request method is get and the parameter id
@RequestHeader: not commonly used
@CookieValue
- Role: Pass the value of the specified cookie name into the controller method parameter
@ModelAttribute
- Function: Modify methods and parameters
- how: This modification is executed first
@SessionAttributes
- Function: used for parameter sharing between multiple execution controller methods
- attributes
–value
–type-stored data type
边栏推荐
- Database implements distributed locks
- LeetCode简单题之两个数组间的距离值
- The Map Entry understanding and application
- IDEA常用快捷键与插件
- Ambiguous method call.both
- Just debuted "Fight to Fame", safety and comfort are not lost
- Daily practice of LeetCode - palindrome structure of OR36 linked list
- [Godot][GDScript] 二维洞穴地图随机生成
- $parent/$children 与 ref
- 想从手工测试转岗自动化测试,需要学习哪些技能?
猜你喜欢
[C language] General method of expression evaluation
LocalDate加减操作及比较大小
数据库实现分布式锁
想从手工测试转岗自动化测试,需要学习哪些技能?
MultipartFile file upload
5. How does the SAP ABAP OData service support the $filter operation
[C language] Preprocessing operation
Unity2D 自定义Scriptable Tiles的理解与使用(四)——开始着手构建一个基于Tile类的自定义tile(下)
一份高质量的测试用例如何养成?
端口排查步骤-7680端口分析-Dosvc服务
随机推荐
STM32问题合集
Component pass value provide/inject
endian mode
Automation strategies for legacy systems
Based on the local, linking the world | Schneider Electric "Industrial SI Alliance" joins hands with partners to go to the future industry
从滴滴罚款后数据治理思考
type_traits元编程库学习
The use of beforeDestroy and destroyed
QML的使用
C语言从入门到如土——数据的存储
$attrs/$listeners
Why SocialFi achievement Web3 decentralized social in the future
Getting Started with CefSharp - winform
Pytest电商项目实战(上)
Pytest e-commerce project combat (on)
MultipartFile file upload
Distributed locks and three implementation methods
Safety 20220712
web容器及IIS --- 中间件渗透方法1
What is a system?