Author: dkulp
Date: Thu Jun 12 10:50:32 2008
New Revision: 667181
URL: http://svn.apache.org/viewvc?rev=667181&view=rev
Log:
Merged revisions 667178 via svnmerge from
https://svn.apache.org/repos/asf/cxf/trunk
........
r667178 | dkulp | 2008-06-12 13:44:13 -0400 (Thu, 12 Jun 2008) | 2 lines
[CXF-1630] Add sorting to the service list
........
Modified:
cxf/branches/2.0.x-fixes/ (props changed)
cxf/branches/2.0.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java
Propchange: cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified:
cxf/branches/2.0.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java?rev=667181&r1=667180&r2=667181&view=diff
==============================================================================
---
cxf/branches/2.0.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java
(original)
+++
cxf/branches/2.0.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java
Thu Jun 12 10:50:32 2008
@@ -21,7 +21,10 @@
import java.io.IOException;
import java.io.OutputStream;
import java.net.URL;
-import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.LinkedList;
+import java.util.List;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -185,7 +188,6 @@
return;
}
- Collection<ServletDestination> destinations =
transport.getDestinations();
response.setContentType("text/html");
response.setCharacterEncoding("UTF-8");
@@ -205,6 +207,16 @@
response.getWriter().write("<title>CXF - Service list</title>");
response.getWriter().write("</head><body>");
if (!isHideServiceList) {
+ List<ServletDestination> destinations
+ = new
LinkedList<ServletDestination>(transport.getDestinations());
+ Collections.sort(destinations, new
Comparator<ServletDestination>() {
+ public int compare(ServletDestination o1, ServletDestination
o2) {
+ return o1.getEndpointInfo().getInterface().getName()
+ .getLocalPart().compareTo(o2.getEndpointInfo()
+
.getInterface().getName().getLocalPart());
+ }
+ });
+
if (destinations.size() > 0) {
response.getWriter().write("<span class=\"heading\">Available
services:</span><br/>");
response.getWriter().write("<table " + (serviceListStyleSheet
== null