Skip to content

Commit

Permalink
Fix for NR-266822 where false APIs reported for servlet using applica…
Browse files Browse the repository at this point in the history
…tions
  • Loading branch information
IshikaDawda committed Nov 22, 2024
1 parent b6443b7 commit df473df
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ public class HttpServletHelper {
public static void gatherURLMappings(ServletContext servletContext) {
try {
Map<String, ? extends ServletRegistration> servletRegistrations = servletContext.getServletRegistrations();
getJSPMappings(servletContext, SEPARATOR);

String contextPath = StringUtils.removeStart(StringUtils.removeEnd(servletContext.getContextPath(), SEPARATOR), StringUtils.SEPARATOR);
if (!StringUtils.equalsAny(contextPath, "docs", "examples")) {
getJSPMappings(servletContext, SEPARATOR);
}
for (ServletRegistration servletRegistration : servletRegistrations.values()) {
for (String mapping : servletRegistration.getMappings()) {
URLMappingsHelper.addApplicationURLMapping(new ApplicationURLMapping(WILDCARD, mapping, servletRegistration.getClassName()));
Expand Down

0 comments on commit df473df

Please sign in to comment.