From 4598f454764ae1b8f7635e36f7ac6abe13c14a03 Mon Sep 17 00:00:00 2001 From: Gao Hongtao Date: Sun, 28 Oct 2018 20:13:33 +0800 Subject: [PATCH] Webapp/proxy (#1831) * Remove backend service discovery * Add undefined node icon * Add undefined node icon * Handle forward "/" to "index.html" --- .../apache/skywalking/apm/webapp/proxy/MvcConfig.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/apm-webapp/src/main/java/org/apache/skywalking/apm/webapp/proxy/MvcConfig.java b/apm-webapp/src/main/java/org/apache/skywalking/apm/webapp/proxy/MvcConfig.java index 81c40ba280..e3d1322a18 100644 --- a/apm-webapp/src/main/java/org/apache/skywalking/apm/webapp/proxy/MvcConfig.java +++ b/apm-webapp/src/main/java/org/apache/skywalking/apm/webapp/proxy/MvcConfig.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.Arrays; import org.springframework.context.annotation.Configuration; import org.springframework.core.io.Resource; -import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import org.springframework.web.servlet.resource.PathResourceResolver; @@ -33,22 +32,22 @@ import org.springframework.web.servlet.resource.PathResourceResolver; * @author gaohongtao */ @Configuration -@EnableWebMvc public class MvcConfig extends WebMvcConfigurerAdapter { + @Override public void addResourceHandlers(final ResourceHandlerRegistry registry) { registry - .addResourceHandler("/**") - .addResourceLocations("classpath:/public/") + .addResourceHandler("/img/node/**") + .addResourceLocations("classpath:/public/img/node/") .setCachePeriod(3600) .resourceChain(true) .addResolver(new PathResourceResolver() { @Override protected Resource getResource(String resourcePath, Resource location) throws IOException { Resource raw = super.getResource(resourcePath, location); - if (raw != null || !resourcePath.startsWith("img/node")) { + if (raw != null) { return raw; } - Resource resource = location.createRelative("img/node/UNDEFINED.png"); + Resource resource = location.createRelative("UNDEFINED.png"); if (!resource.exists() || !resource.isReadable()) { return null; } -- GitLab