Repository: cxf Updated Branches: refs/heads/3.0.x-fixes 76d0f03c8 -> 037992d81
Updating the services list formatters to drop SOAP or REST text if no relevant endpoints exist Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/037992d8 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/037992d8 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/037992d8 Branch: refs/heads/3.0.x-fixes Commit: 037992d81cf809eb6168e576a81601b9a9d7e74f Parents: 76d0f03 Author: Sergey Beryozkin <[email protected]> Authored: Mon Jun 27 12:03:08 2016 +0100 Committer: Sergey Beryozkin <[email protected]> Committed: Mon Jun 27 17:04:17 2016 +0100 ---------------------------------------------------------------------- .../servlet/servicelist/FormattedServiceListWriter.java | 8 ++++++-- .../servlet/servicelist/UnformattedServiceListWriter.java | 10 +++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/037992d8/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/FormattedServiceListWriter.java ---------------------------------------------------------------------- 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 c26b43f..7903f86 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 @@ -62,8 +62,12 @@ public class FormattedServiceListWriter implements ServiceListWriter { writer.write("</head><body>"); if (soapDestinations.length > 0 || restDestinations.length > 0) { - writeSOAPEndpoints(writer, basePath, soapDestinations); - writeRESTfulEndpoints(writer, basePath, restDestinations); + if (soapDestinations.length > 0) { + writeSOAPEndpoints(writer, basePath, soapDestinations); + } + if (restDestinations.length > 0) { + writeRESTfulEndpoints(writer, basePath, restDestinations); + } } else { writer.write("<span class=\"heading\">No services have been found.</span>"); } http://git-wip-us.apache.org/repos/asf/cxf/blob/037992d8/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/UnformattedServiceListWriter.java ---------------------------------------------------------------------- diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/UnformattedServiceListWriter.java b/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/UnformattedServiceListWriter.java index d5a5e2c..5650c92 100644 --- a/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/UnformattedServiceListWriter.java +++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/UnformattedServiceListWriter.java @@ -36,12 +36,16 @@ public class UnformattedServiceListWriter implements ServiceListWriter { } public void writeServiceList(PrintWriter writer, - String baseAddress, + String basePath, AbstractDestination[] soapDestinations, AbstractDestination[] restDestinations) throws IOException { if (soapDestinations.length > 0 || restDestinations.length > 0) { - writeUnformattedSOAPEndpoints(writer, baseAddress, soapDestinations); - writeUnformattedRESTfulEndpoints(writer, baseAddress, restDestinations); + if (soapDestinations.length > 0) { + writeUnformattedSOAPEndpoints(writer, basePath, soapDestinations); + } + if (restDestinations.length > 0) { + writeUnformattedRESTfulEndpoints(writer, basePath, restDestinations); + } } else { writer.write("No services have been found."); }
