1 19 20 package org.apache.excalibur.instrument.manager.http; 21 22 import java.io.FileNotFoundException ; 23 import java.io.IOException ; 24 import java.io.PrintWriter ; 25 import java.util.Map ; 26 27 import org.apache.excalibur.instrument.manager.http.server.HTTPRedirect; 28 import org.apache.excalibur.instrument.manager.DefaultInstrumentManager; 29 30 36 public class HTMLRootHandler 37 extends AbstractHTMLHandler 38 { 39 42 48 public HTMLRootHandler( DefaultInstrumentManager manager, 49 InstrumentManagerHTTPConnector connector ) 50 { 51 super( "/", manager, connector ); 52 } 53 54 57 64 public void doGet( String path, Map parameters, PrintWriter out ) 65 throws IOException 66 { 67 if ( path.endsWith( ".xml" ) ) 69 { 70 throw new FileNotFoundException ( "The Requested page does not exist" ); 71 } 72 73 if ( path.indexOf( '/', 1 ) >= 0 ) 74 { 75 throw new HTTPRedirect( "../instrument-manager.html" ); 77 } 78 else 79 { 80 throw new HTTPRedirect( "instrument-manager.html" ); 81 } 82 } 83 } 84 85 | Popular Tags |