Skip to content

Commit

Permalink
Merge pull request #543 from CC11001100/develop
Browse files Browse the repository at this point in the history
fix: spring mvc api gather path with ContextPath
  • Loading branch information
lostsnow committed Jul 4, 2023
2 parents 87dd311 + d5a8659 commit 0c863d0
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ private void parsePathPatternsRequestCondition() {
Path path = new Path();
// 方法是第二级
parseRequestMethodsRequestCondition(path);
pathMap.put(s, path);
pathMap.put(buildFullUrl(s), path);
});
}
} catch (Throwable e) {
Expand All @@ -73,7 +73,7 @@ public void accept(String s) {
Path path = new Path();
// 方法是第二级
parseRequestMethodsRequestCondition(path);
pathMap.put(s, path);
pathMap.put(buildFullUrl(s), path);
}
});
}
Expand All @@ -82,6 +82,15 @@ public void accept(String s) {
}
}

private String buildFullUrl(String path) {
String contextPath = this.webApplicationContext.getApplicationName();
if (contextPath == null || contextPath.isEmpty()) {
return path;
} else {
return contextPath + path;
}
}

/**
* 根据请求方法扩展为多个
*/
Expand Down

0 comments on commit 0c863d0

Please sign in to comment.