SpringBoot There is a problem when using @ RequestParam to receive parameters

As mentioned above, when using the @ RequestParm annotation to receive parameters, the following is my request result Only parameters in the URL can be received, and cannot be received anywhere else, such as multipart/form data

It can be received normally in the 2. x spring boot, and the version number I am using is spring boot: 3.0.5

Usage: webflux

SpringBoot There is a problem when using @ RequestParam to receive parameters

SpringBoot There is a problem when using @ RequestParam to receive parameters

SpringBoot There is a problem when using @ RequestParam to receive parameters

Comment From: wilkinsona

Thanks for the report. Unfortunately, it doesn't contain enough information for us to be able to help you. It's very hard to reverse engineer things from a brief description and a few screenshots. If you would like us to spend some more time investigating, please spend some time providing a complete yet minimal sample that reproduces the problem. You can share it with us by pushing it to a separate repository on GitHub or by zipping it up and attaching it to this issue.

Comment From: zhangpan-soft

感谢您的报告。不幸的是,它没有包含足够的信息,我们无法为您提供帮助。从简短的描述和一些屏幕截图很难对事物进行逆向工程。如果您希望我们花更多时间进行调查,请花一些时间提供一个完整但最小的示例来重现该问题。您可以通过将其推送到 GitHub 上的单独存储库或通过压缩并将其附加到此问题来与我们分享。

I have confirmed that webflux cannot use @ RequestParam to obtain non URL parameters I may need some settings, but I don't know how to set them

For the problem of recurrence, you can create a webflux demo at random, and then use @ RequestParam to obtain parameters instead of functional programming, and use post requests to place parameters in the form instead of query to reproduce the problem

In addition, ServerWebExchange only obtains the getQueryParam method, without obtaining the parameters in the body That is to say, the form request parameters using the post method cannot be obtained, or even those using body to pass parameters cannot be obtained, including the @ RequestBody annotation

Therefore, I believe it is a bug and not friendly enough

Based on the above reasons, I have switched from webflux to webmvc

I have decided that the future of webflux is very broad, but it seems a bit tricky to write about. I hope it can be better compatible with Spring's own web annotations, so that we can better use webflux instead of mvc

Comment From: wilkinsona

Thanks for the additional information. This is working as documented in the @RequestParam javadoc:

In Spring WebFlux, "request parameters" map to query parameters only. To work with all 3, query, form data, and multipart data, you can use data binding to a command object annotated with ModelAttribute

Also, please note that @RequestParam is part of Spring Framework which is managed as a separate project.