Repository: cxf Updated Branches: refs/heads/master 0eafb7f88 -> 6ba5249f2
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/6ba5249f Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/6ba5249f Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/6ba5249f Branch: refs/heads/master Commit: 6ba5249f2e42bf5e95652cd580556acbf6fb4fd9 Parents: 0eafb7f Author: Sergey Beryozkin <[email protected]> Authored: Mon Jun 27 12:03:08 2016 +0100 Committer: Sergey Beryozkin <[email protected]> Committed: Mon Jun 27 12:03:08 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/6ba5249f/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/6ba5249f/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."); }
