Author: keith
Date: Mon Jan  7 07:48:34 2008
New Revision: 11966

Log:

Fixing Mashup-499



Modified:
   
trunk/mashup/java/modules/core/src/org/wso2/mashup/transport/ServiceUIFilter.java

Modified: 
trunk/mashup/java/modules/core/src/org/wso2/mashup/transport/ServiceUIFilter.java
==============================================================================
--- 
trunk/mashup/java/modules/core/src/org/wso2/mashup/transport/ServiceUIFilter.java
   (original)
+++ 
trunk/mashup/java/modules/core/src/org/wso2/mashup/transport/ServiceUIFilter.java
   Mon Jan  7 07:48:34 2008
@@ -36,6 +36,7 @@
 import javax.servlet.http.HttpServletResponse;
 import java.io.File;
 import java.io.IOException;
+import java.io.OutputStream;
 
 /**
  * <p/>
@@ -104,7 +105,19 @@
                         .getServiceForActivation(serviceName);
 
                 //Serve the custom UI only if the service is deployed and 
active.
-                if ((axisService != null) && (axisService.isActive())) {
+                if (axisService != null) {
+
+                    if (!axisService.isActive()) {
+                        OutputStream outputStream = 
httpServletResponse.getOutputStream();
+                        httpServletResponse.setContentType("text/html");
+                        
httpServletResponse.setStatus(HttpServletResponse.SC_SERVICE_UNAVAILABLE);
+                        outputStream
+                                .write(("<h4>Service " + serviceName +
+                                        " is inactive. Cannot display <em>web 
resources</em>.</h4>")
+                                        .getBytes());
+                        outputStream.flush();
+                        return;
+                    }
                     //We assume that a file name will have '.'
                     int indexOfDot = requestPath.lastIndexOf(".");
                     boolean isFile = false;

_______________________________________________
Mashup-dev mailing list
[email protected]
http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev

Reply via email to