This is an automated email from the ASF dual-hosted git repository.

dkulp pushed a commit to branch 3.2.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git


The following commit(s) were added to refs/heads/3.2.x-fixes by this push:
     new 13d3232  [CXF-7875] Fix links to swagger/wadl in Karaf
13d3232 is described below

commit 13d3232236e57cefb59ddf943ee38045f54453a9
Author: Daniel Kulp <dk...@apache.org>
AuthorDate: Mon Oct 15 13:06:51 2018 -0400

    [CXF-7875] Fix links to swagger/wadl in Karaf
---
 .../org/apache/cxf/transport/http/osgi/ServletExporter.java | 10 +++++-----
 .../servlet/servicelist/FormattedServiceListWriter.java     | 13 ++++++++++---
 2 files changed, 15 insertions(+), 8 deletions(-)

diff --git 
a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/osgi/ServletExporter.java
 
b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/osgi/ServletExporter.java
index 60652f5..d3c113e 100644
--- 
a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/osgi/ServletExporter.java
+++ 
b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/osgi/ServletExporter.java
@@ -61,11 +61,11 @@ class ServletExporter implements ManagedService {
                 } else {
                     LOG.log(Level.SEVERE, e.getMessage(), e);
                 }
-                if (properties == null) {
-                    // we're simply stopping. if we couldn't unregister, that 
means we had to little time to register
-                    // otherwise, we'll try to register the servlet
-                    return;
-                }
+            }
+            if (properties == null) {
+                // we're simply stopping. if we couldn't unregister, that 
means we had to little time to register
+                // otherwise, we'll try to register the servlet
+                return;
             }
             alias = null;
         }
diff --git 
a/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/FormattedServiceListWriter.java
 
b/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/FormattedServiceListWriter.java
index 5f09569..04fe879 100644
--- 
a/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/FormattedServiceListWriter.java
+++ 
b/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/FormattedServiceListWriter.java
@@ -28,6 +28,7 @@ import org.apache.cxf.common.util.PropertyUtils;
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.service.model.OperationInfo;
 import org.apache.cxf.transport.AbstractDestination;
+import org.apache.cxf.transport.http.AbstractHTTPDestination;
 
 public class FormattedServiceListWriter implements ServiceListWriter {
     private String styleSheetPath;
@@ -172,13 +173,19 @@ public class FormattedServiceListWriter implements 
ServiceListWriter {
         writer.write("<tr><td>");
         writer.write("<span class=\"field\">Endpoint address:</span> " + 
"<span class=\"value\">"
                      + absoluteURL + "</span>");
-        if (bus != null && 
PropertyUtils.isTrue(bus.getProperty("wadl.service.description.available"))) {
+        
+        Bus sb = bus;
+        if (sd instanceof AbstractHTTPDestination) {
+            sb = ((AbstractHTTPDestination)sd).getBus();
+        }        
+        
+        if (sb != null && 
PropertyUtils.isTrue(sb.getProperty("wadl.service.description.available"))) {
             writer.write("<br/><span class=\"field\">WADL :</span> " + "<a 
href=\"" + absoluteURL
                      + "?_wadl\">" + absoluteURL + "?_wadl" + "</a>");
         }
-        if (bus != null && 
PropertyUtils.isTrue(bus.getProperty("swagger.service.description.available"))) 
{
+        if (sb != null && 
PropertyUtils.isTrue(sb.getProperty("swagger.service.description.available"))) {
             String swaggerPath = "swagger.json";
-            if 
(PropertyUtils.isTrue(bus.getProperty("swagger.service.ui.available"))) {
+            if 
(PropertyUtils.isTrue(sb.getProperty("swagger.service.ui.available"))) {
                 URI uri = URI.create(absoluteURL);
                 String schemePath = uri.getScheme() + "://" + uri.getHost()
                     + (uri.getPort() == -1 ? "" : ":" + uri.getPort());

Reply via email to