1 16 17 package org.apache.axis.transport.http; 18 19 import java.io.PrintWriter ; 20 import java.net.HttpURLConnection ; 21 22 import javax.servlet.http.HttpServletResponse ; 23 24 import org.apache.axis.AxisFault; 25 import org.apache.axis.MessageContext; 26 import org.apache.axis.server.AxisServer; 27 import org.apache.axis.utils.Admin; 28 import org.apache.axis.utils.Messages; 29 import org.apache.axis.utils.XMLUtils; 30 import org.w3c.dom.Document ; 31 32 41 42 public class QSListHandler extends AbstractQueryStringHandler { 43 51 52 public void invoke (MessageContext msgContext) throws AxisFault { 53 56 boolean enableList = ((Boolean ) msgContext.getProperty 57 (HTTPConstants.PLUGIN_ENABLE_LIST)).booleanValue(); 58 AxisServer engine = (AxisServer) msgContext.getProperty 59 (HTTPConstants.PLUGIN_ENGINE); 60 PrintWriter writer = (PrintWriter ) msgContext.getProperty 61 (HTTPConstants.PLUGIN_WRITER); 62 HttpServletResponse response = (HttpServletResponse ) 63 msgContext.getProperty (HTTPConstants.MC_HTTP_SERVLETRESPONSE); 64 65 if (enableList) { 66 Document doc = Admin.listConfig (engine); 67 68 if (doc != null) { 69 response.setContentType ("text/xml"); 70 XMLUtils.DocumentToWriter (doc, writer); 71 } 72 73 else { 74 76 response.setStatus (HttpURLConnection.HTTP_NOT_FOUND); 77 response.setContentType ("text/html"); 78 79 writer.println ("<h2>" + Messages.getMessage ("error00") + 80 "</h2>"); 81 writer.println ("<p>" + Messages.getMessage ("noDeploy00") + 82 "</p>"); 83 } 84 } 85 86 else { 87 90 response.setStatus (HttpURLConnection.HTTP_FORBIDDEN); 91 response.setContentType ("text/html"); 92 93 writer.println ("<h2>" + Messages.getMessage ("error00") + 94 "</h2>"); 95 writer.println ("<p><i>?list</i> " + 96 Messages.getMessage ("disabled00") + "</p>"); 97 } 98 } 99 } 100 | Popular Tags |