-
Notifications
You must be signed in to change notification settings - Fork 90
3.0 Upgrade Recipe: Spring MVC and WebFlux URL matching changes [PathMatchConfigurer
]
#248
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
Comments
PathMatchConfigurer
]
@fabapp2 sorry for the late reply , I was going through the documentation you provided , so we need to enable Trailing Slash Match inside the WebMVCAutoConfiguration ? |
@ishu-thakur correct. it's basically adding the given source code to the ProjectContext (to topmost application modules). projectContext.getApplicationModules().getTopmostApplicationModules().stream()
.forEach(m -> {
String basePackage = m.getMainJavaSourceSet().getJavaSourceLocation().getPackageName();
String code = renderJavaCode(basePackage);
m.getMainJavaSourceSet().addJavaSource(projectContext, code, basePackage);
}); Simplified as it should have a check for the unlikely case that a class with the chosen name already exists in the package and choosing a different name in this case. The |
@fabapp2 for clarity I want to ask you that
|
Hi @ishu-thakur Great questions!
That's correct, actually this changed in the branch
The api to access "topmost" modules, actually modules that will create a deployable (e.g. a web application, or a shell application), these are currently the modules that no other module in the scanned project depends on. projectContext.getApplicationModules().getTopmostApplicationModules();
For "migrations", called "recipe" in the issue (I should change this), there's nothing to do with freemarker. You might want to look into
Totally fine. Sorry for my late reply. |
Hi @ishu-thakur, any news on this? Let me know if I can help. |
Hi @fabapp2 I'm sorry for late reply , I got busy with my work . But if this issue is still open i can start working on it again ? |
Hi @ishu-thakur glad to have you back. |
Uh oh!
There was an error while loading. Please reload this page.
labels: ["type: enhancement","good first issue","upgrade:boot-recipe","3.0.0"]
What needs to be done
An automated migration recipe for remediation possibility 4 of
Spring MVC and WebFlux URL matching changes
should be created.Reset behavior to prior 3.0 by configuring
PathMatchConfigurer
(option 4 in #522)This automated migration recipe should add the
WebMvcConfigurer
to reset the behavior to 2.7.Release Note
As of Spring Framework 6.0, the trailing slash matching configuration option has been deprecated and its default value set to
false
. This means that previously, the following controller would match both "GET /some/greeting" and "GET /some/greeting/":As of this Spring Framework change, "GET /some/greeting/" doesn?t match anymore by default.
Developers should instead configure explicit redirects/rewrites through a proxy, a Servlet/web filter, or even declare the additional route explicitly on the controller handler (like
@GetMapping("/some/greeting", "/some/greeting/")
for more targeted cases.Until your application fully adapts to this change, you can change the default with the following global configuration:
Condition
Any class annotated with
@RestController
was found.Description
There's more than one way to deal with the change of
Spring MVC and WebFlux URL matching changes
.This issue should provide a recipe to add a
WebMvcConfigurer
as described in the Release Notes.Things to keep in mind:
YAML
recipe declaration should be provided to reference this recipe from the report section (3.0 Upgrade Report: Spring MVC and WebFlux URL matching changes #522)sbu30-248-add-PathMatchConfigurer
Report Section Issue
#522
DoD
Additional Resources & Information
TODO for template, link to:
The text was updated successfully, but these errors were encountered: