Skip to content

Commit

Permalink
代码优化
Browse files Browse the repository at this point in the history
  • Loading branch information
smthing committed Aug 12, 2024
1 parent 63fa90d commit 1446d79
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<packaging>pom</packaging>

<properties>
<smarthttp.version>1.5.7</smarthttp.version>
<smarthttp.version>1.5.8</smarthttp.version>
<smartservlet.version>2.1</smartservlet.version>

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,17 @@ public HttpServletMapping getHttpServletMapping() {
String matchValue;
MappingMatch mappingMatch = servletMappingInfo.getMappingType();
switch (servletMappingInfo.getMappingType()) {
case DEFAULT:
matchValue = "";
if (StringUtils.isBlank(getServletContext().getContextPath())) {
mappingMatch = MappingMatch.CONTEXT_ROOT;
}
break;
case EXACT:
matchValue = servletMappingInfo.getMapping();
if (matchValue.startsWith("/")) {
matchValue = matchValue.substring(1);
}
if (matchValue.isEmpty()) {
mappingMatch = StringUtils.isBlank(getServletContext().getContextPath()) ? MappingMatch.CONTEXT_ROOT : MappingMatch.DEFAULT;
}
break;
case PATH:
String servletPath = getServletPath();
Expand Down

0 comments on commit 1446d79

Please sign in to comment.