public void handleRequest(String request,OutputStream out) throws IOException, MapRequestFormatException {
  Properties requestProperties=convertRequestToProps(request);
  String requestType=requestProperties.getProperty(REQUEST);
  if (requestType != null) {
    if (requestType.equalsIgnoreCase(MAP)) {
      Debug.message("imageserver","MRH: Map request...");
      handleMapRequest(requestProperties,out);
    }
 else     if (requestType.equalsIgnoreCase(CAPABILITIES)) {
      Debug.message("imageserver","MRH: Capabilities request...");
      handleCapabilitiesRequest(requestProperties,out);
    }
 else     if (requestType.equalsIgnoreCase(PAN)) {
      Debug.message("imageserver","MRH: Pan request...");
      handlePanRequest(requestProperties,out);
    }
 else     if (requestType.equalsIgnoreCase(RECENTER)) {
      Debug.message("imageserver","MRH: Recenter request...");
      handleRecenterRequest(requestProperties,out);
    }
 else {
      throw new MapRequestFormatException("Request type not handled: " + requestType);
    }
  }
 else {
    throw new MapRequestFormatException("Request not understood: " + request);
  }
}

public void handleRequest ( String request , OutputStream out ) throws IOException , MapRequestFormatException { Properties requestProperties = convertRequestToProps ( request ) ; String requestType = requestProperties . getProperty ( REQUEST ) ; if ( requestType != null ) { if ( requestType . equalsIgnoreCase ( MAP ) ) { Debug . message ( "imageserver" , "MRH: Map request..." ) ; handleMapRequest ( requestProperties , out ) ; } else if ( requestType . equalsIgnoreCase ( CAPABILITIES ) ) { Debug . message ( "imageserver" , "MRH: Capabilities request..." ) ; handleCapabilitiesRequest ( requestProperties , out ) ; } else if ( requestType . equalsIgnoreCase ( PAN ) ) { Debug . message ( "imageserver" , "MRH: Pan request..." ) ; handlePanRequest ( requestProperties , out ) ; } else if ( requestType . equalsIgnoreCase ( RECENTER ) ) { Debug . message ( "imageserver" , "MRH: Recenter request..." ) ; handleRecenterRequest ( requestProperties , out ) ; } else { throw new MapRequestFormatException ( "Request type not handled: " + requestType ) ; } } else { throw new MapRequestFormatException ( "Request not understood: " + request ) ; } }
given a general request , parse it and handle it . appends a content type to the output stream which may mess things up for servlets asking for images .
