Spring引导MultipartFile请求返回404
I make post multipart request and get 404
see that:
the path is correct!!
here it is my controlller:
my controller
here it is my Bean:
Bean registration
Please note that i dont get any error!!
Only 404
What can be the isssue?
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将控制器类的注释从 @Controller 更改为 @RestController 解决了我的问题。
Changing the annotation of the controller class from @Controller to @RestController solved my issue.
更新
我已经找到问题了
我有两种控制器
1 - Javax(雅加达)控制器,前缀为“rest”
2 - Spring控制器(我试图创建)具有相同的“rest前缀”
我知道我们不能让那些不同的控制器具有相同的前缀,这会导致冲突
我刚刚将第二个前缀重命名为“restapi”,两者都正常工作!
我花了两周时间才解决这个问题:)
UPDATE
I have found the issue
I have 2 kind of controllers
1 - Javax (Jakarta) controller with prefix "rest"
2 - Spring Controller (that i tried to create) with same "rest prefix
I understood that we cannot have those different controllers with same prefix this causes a conflict
I have just renamed the second prefix to "restapi" and both are working!
It took me 2 weeks to resolve it :)