From b41fae1eee6521287a8f5a9ff0b9a2f33f7a4a5f Mon Sep 17 00:00:00 2001 From: Michael Dürre Date: Thu, 6 Apr 2023 11:38:19 +0200 Subject: fix odlux core servlets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit add whiteboard annotations Issue-ID: CCSDK-3886 Signed-off-by: Michael Dürre Change-Id: I40e85179f4d353adffede90e2e3f2c4c181b8ce2 Signed-off-by: Michael Dürre --- sdnr/wt/odlux/core/provider/pom.xml | 10 ++++++++-- .../onap/ccsdk/features/sdnr/wt/odlux/IndexServlet.java | 8 ++++++++ .../onap/ccsdk/features/sdnr/wt/odlux/ResFilesServlet.java | 7 +++++++ .../src/main/resources/OSGI-INF/blueprint/blueprint.xml | 14 ++------------ 4 files changed, 25 insertions(+), 14 deletions(-) diff --git a/sdnr/wt/odlux/core/provider/pom.xml b/sdnr/wt/odlux/core/provider/pom.xml index 0b07aa542..36a8df32b 100644 --- a/sdnr/wt/odlux/core/provider/pom.xml +++ b/sdnr/wt/odlux/core/provider/pom.xml @@ -72,8 +72,8 @@ guava - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api org.mockito @@ -96,6 +96,12 @@ ${project.version} test + + org.osgi + osgi.cmpn + 7.0.0 + compile + diff --git a/sdnr/wt/odlux/core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/IndexServlet.java b/sdnr/wt/odlux/core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/IndexServlet.java index a7cc2ac82..b88a01225 100644 --- a/sdnr/wt/odlux/core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/IndexServlet.java +++ b/sdnr/wt/odlux/core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/IndexServlet.java @@ -22,13 +22,21 @@ import java.io.IOException; import java.io.OutputStream; import java.net.HttpURLConnection; import java.nio.file.Files; +import javax.servlet.Servlet; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; + +import org.osgi.service.component.annotations.Component; +import org.osgi.service.http.whiteboard.propertytypes.HttpWhiteboardServletName; +import org.osgi.service.http.whiteboard.propertytypes.HttpWhiteboardServletPattern; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +@HttpWhiteboardServletPattern({"/favicon.ico","/index2.html"}) +@HttpWhiteboardServletName("IndexServlet") +@Component(service = Servlet.class) public class IndexServlet extends HttpServlet { private static final long serialVersionUID = 3039669437157215355L; diff --git a/sdnr/wt/odlux/core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/ResFilesServlet.java b/sdnr/wt/odlux/core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/ResFilesServlet.java index c9d8a2d20..8d4e05a96 100644 --- a/sdnr/wt/odlux/core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/ResFilesServlet.java +++ b/sdnr/wt/odlux/core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/ResFilesServlet.java @@ -22,14 +22,21 @@ import java.io.File; import java.io.IOException; import java.io.OutputStream; import java.net.HttpURLConnection; +import javax.servlet.Servlet; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.onap.ccsdk.features.sdnr.wt.odlux.model.bundles.OdluxBundleLoader; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.http.whiteboard.propertytypes.HttpWhiteboardServletName; +import org.osgi.service.http.whiteboard.propertytypes.HttpWhiteboardServletPattern; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +@HttpWhiteboardServletPattern("/odlux/*") +@HttpWhiteboardServletName("ResFilesServlet") +@Component(service = Servlet.class) public class ResFilesServlet extends HttpServlet { private static final long serialVersionUID = -6807215213921798293L; diff --git a/sdnr/wt/odlux/core/provider/src/main/resources/OSGI-INF/blueprint/blueprint.xml b/sdnr/wt/odlux/core/provider/src/main/resources/OSGI-INF/blueprint/blueprint.xml index 250be6017..d06b77fb5 100644 --- a/sdnr/wt/odlux/core/provider/src/main/resources/OSGI-INF/blueprint/blueprint.xml +++ b/sdnr/wt/odlux/core/provider/src/main/resources/OSGI-INF/blueprint/blueprint.xml @@ -22,7 +22,7 @@ - @@ -30,27 +30,17 @@ - + --> - - - - - - - - - - -- cgit 1.2.3-korg