We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The following code:
@RestController @RequestMapping("/index") public class BController { /** * index-b */ @GetMapping public String index() { return "b"; } }
The expected generated URL is: /index
/index
The actual generated URL is: /index/.
/index/
In Spring Boot 3 (Framework 6.0), /index/ no longer matches /index. ,[Spring-Boot-3.0-Migration-Guide](https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide#spring-mvc-and-webflux-url-matching-changes)。This results in a 404 error when debugging on the DEBUG page.
com.power.doc.utils.DocUrlUtil#getMvcUrls() If the URL is an empty string in the method, do not concatenate it, as shown below:
com.power.doc.utils.DocUrlUtil#getMvcUrls()
public static String getMvcUrls(String baseServer, String baseUrl, List<String> urls) { StringBuilder sb = new StringBuilder(); List<String> baseUrls = DocUtil.split(baseUrl); int size = urls.size(); int baseSize = baseUrls.size(); for (int j = 0; j < baseSize; j++) { String base = baseUrls.get(j); String trimBase = Optional.ofNullable(StringUtil.trimBlank(base)).orElse(StringUtil.EMPTY); trimBase = trimBase.replace("[", "").replace("]", ""); for (int i = 0; i < size; i++) { String trimUrl = Optional.ofNullable(StringUtil.trimBlank(urls.get(i))).orElse(StringUtil.EMPTY); // String url = baseServer + "/" + trimBase + "/" + trimUrl; // Change to the following statement: String url = baseServer + "/" + trimBase + (StringUtil.isNotEmpty(trimUrl) ? "/" + trimUrl : ""); sb.append(UrlUtil.simplifyUrl(url)); if (i < size - 1) { sb.append(DocGlobalConstants.MULTI_URL_SEPARATOR); } } if (j < baseSize - 1) { sb.append(DocGlobalConstants.MULTI_URL_SEPARATOR); } } return sb.toString(); }
As above
It currently only affects debugging on the DEBUG page.
The text was updated successfully, but these errors were encountered:
Since the changes have been made, you can directly submit a pull request. 改都改了 可以直接提pr的
Sorry, something went wrong.
Merge pull request #398 from shalousun/master
3144600
fix: ##396
No branches or pull requests
Your Environment(您的使用环境)
Expected Behavior(您期望的结果)
The following code:
The expected generated URL is:
/index
Current Behavior(当前结果)
The actual generated URL is:
/index/
.In Spring Boot 3 (Framework 6.0),
/index/
no longer matches/index
. ,[Spring-Boot-3.0-Migration-Guide](https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide#spring-mvc-and-webflux-url-matching-changes)。This results in a 404 error when debugging on the DEBUG page.Possible Solution(bug解决建议)
com.power.doc.utils.DocUrlUtil#getMvcUrls()
If the URL is an empty string in the method, do not concatenate it, as shown below:Steps to Reproduce (Bug产生步骤,请尽量提供用例代码)
As above
Context(Bug影响描述)
It currently only affects debugging on the DEBUG page.
The text was updated successfully, but these errors were encountered: