-
Notifications
You must be signed in to change notification settings - Fork 38.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid re-creating HandlerMethod unless handler is resolved through the BeanFactory #34277
Comments
The main reason for We can update |
Can change private HandlerMethod(HandlerMethod handlerMethod, @Nullable Object handler, boolean initValidateFlags) |
@rstoyanchev |
I am re-opening as the changes caused test failures in Boot tests related to CORS configuration. |
@brucelwl, I'll have a look at making the HandlerMethod constructor protected. In terms of initialization and |
@rstoyanchev Thanks, I resolved the |
@rstoyanchev I delayed the initialization of the my custom RequestMappingHandlerMapping |
As I mentioned before, this is not something we will do in a maintenance release. However, I've created #34375, which turns out is also related to a custom HandlerMethod, and will make some improvements for that scenario. I will comment again under that issue when I have more to share, |
@rstoyanchev Can we solve this problem first and change it to protected, so that I can also custom my own Handler Method, |
HandlerMethod
subclass to be recreated asHandlerMethod
,createWithResolvedBean()
, resulting in the creation of a new instance ofHandlerMethod
. Thehandler
inHandlerMethod
should be determined at startup(main thread), rather than being processed after each callhttps://github.com/spring-projects/spring-framework/blob/main/spring-web/src/main/java/org/springframework/web/method/HandlerMethod.java#L302-L323
my code
The text was updated successfully, but these errors were encountered: