cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r888195 - in /cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet: AbstractServletController.java ServletController.java
Date Mon, 07 Dec 2009 23:47:03 GMT
Author: dkulp
Date: Mon Dec  7 23:47:02 2009
New Revision: 888195

URL: http://svn.apache.org/viewvc?rev=888195&view=rev
Log:
[CXF-2562] Add ability to change service list title.
Patch from RĂ©mi Flament applied.

Modified:
    cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/AbstractServletController.java
    cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/AbstractServletController.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/AbstractServletController.java?rev=888195&r1=888194&r2=888195&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/AbstractServletController.java
(original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/AbstractServletController.java
Mon Dec  7 23:47:02 2009
@@ -31,6 +31,7 @@
     protected boolean disableAddressUpdates;
     protected String forcedBaseAddress;
     protected String serviceListStyleSheet;
+    protected String title;
     protected String serviceListRelativePath = DEFAULT_LISTINGS_CLASSIFIER;
     
     protected AbstractServletController() {
@@ -58,6 +59,9 @@
     public void setServiceListStyleSheet(String serviceListStyleSheet) {
         this.serviceListStyleSheet = serviceListStyleSheet;
     }
+    public void setTitle(String t) {
+        title = t;
+    }
     
     private void init(ServletConfig servletConfig) {
         if (servletConfig == null) {
@@ -84,6 +88,10 @@
         if (serviceListPath != null) {
             serviceListRelativePath = serviceListPath;
         }
+        String configTitle = servletConfig.getInitParameter("service-list-title");
+        if (configTitle != null) {
+            title = configTitle;
+        }
     }
     
     protected String getBaseURL(HttpServletRequest request) {

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java?rev=888195&r1=888194&r2=888195&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java
(original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java
Mon Dec  7 23:47:02 2009
@@ -217,7 +217,11 @@
                                        + request.getRequestURI() + "/?stylesheet=1\">");
           
         }
         response.getWriter().write("<meta http-equiv=content-type content=\"text/html;
charset=UTF-8\">");
-        response.getWriter().write("<title>CXF - Service list</title>");
+        if (title != null) {
+            response.getWriter().write("<title>" + title + "</title>");
+        } else {
+            response.getWriter().write("<title>CXF - Service list</title>");
+        }
         response.getWriter().write("</head><body>");
         
         List<ServletDestination> destinations = getServletDestinations();



Mime
View raw message