src/org/ohmage/jee/servlet/RequestServlet.java
protected void processRequest(
			final HttpServletRequest httpRequest, 
			final HttpServletResponse httpResponse) {
		
		try {
			Request request = RequestBuilder.getInstance().buildRequest(httpRequest);
	
			if(! request.isFailed()) {
				request.service();
			}
			
			request.respond(httpRequest, httpResponse);
			
			httpRequest.setAttribute(KEY_ATTRIBUTE, request);
		}
		catch(IOException e) {
			LOGGER.info(
				"There was an issue reading from the input stream or writing to the output stream.", 
				e);
			respondFailure(httpResponse, 200, ErrorCode.SYSTEM_GENERAL_ERROR, 
					"There was an issue reading from the input stream or writing to the output stream");
		}
		catch(InvalidRequestException e) {
			LOGGER.info("The request was invalid.", e);
			respondFailure(httpResponse, e.getHttpErrorCode(), e.getErrorCode(), e.getErrorText());
		} 
		catch (Exception e) {
			LOGGER.info("There was an issue executing the request.", e);
			respondFailure(httpResponse, 200, ErrorCode.SYSTEM_GENERAL_ERROR, 
					"General server errors occured while executing the request");
		
		}
	}
/**
	 * Builds a Request object. If building the object didn't fail, it will
	 * service the request. Finally, the request will respond.
	 * 
	 * @param httpRequest The HTTP request that is to be built, serviced, and
	 * 					  responded.
	 * 
	 * @param httpResponse The HTTP response that will be sent back to the user
	 * 					   once the request has been processed.
	 */
Builds a Request object. If building the object didn't fail, it will
service the request. Finally, the request will respond.

@param httpRequest The HTTP request that is to be built, serviced, and
responded.

@param httpResponse The HTTP response that will be sent back to the user
once the request has been processed.
Builds a Request object . If building the object didn ' t fail it will service the request . Finally the request will respond . @param httpRequest The HTTP request that is to be built serviced and responded . @param httpResponse The HTTP response that will be sent back to the user once the request has been processed .
protected void processRequest(
			final HttpServletRequest httpRequest, 
			final HttpServletResponse httpResponse) {
		try {
			Request request = RequestBuilder.getInstance().buildRequest(httpRequest);
			if(! request.isFailed()) {
				request.service();
			}
			request.respond(httpRequest, httpResponse);
			httpRequest.setAttribute(KEY_ATTRIBUTE, request);
		}
		catch(IOException e) {
			LOGGER.info(
				"There was an issue reading from the input stream or writing to the output stream.", 
				e);
			respondFailure(httpResponse, 200, ErrorCode.SYSTEM_GENERAL_ERROR, 
					"There was an issue reading from the input stream or writing to the output stream");
		}
		catch(InvalidRequestException e) {
			LOGGER.info("The request was invalid.", e);
			respondFailure(httpResponse, e.getHttpErrorCode(), e.getErrorCode(), e.getErrorText());
		} 
		catch (Exception e) {
			LOGGER.info("There was an issue executing the request.", e);
			respondFailure(httpResponse, 200, ErrorCode.SYSTEM_GENERAL_ERROR, 
					"General server errors occured while executing the request");
		}
	}
protected void processRequest ( final HttpServletRequest httpRequest , final HttpServletResponse httpResponse ) { try { Request request = RequestBuilder . getInstance ( ) . buildRequest ( httpRequest ) ; if ( ! request . isFailed ( ) ) { request . service ( ) ; } request . respond ( httpRequest , httpResponse ) ; httpRequest . setAttribute ( KEY_ATTRIBUTE , request ) ; } catch ( IOException e ) { LOGGER . info ( "There was an issue reading from the input stream or writing to the output stream." , e ) ; respondFailure ( httpResponse , 200 , ErrorCode . SYSTEM_GENERAL_ERROR , "There was an issue reading from the input stream or writing to the output stream" ) ; } catch ( InvalidRequestException e ) { LOGGER . info ( "The request was invalid." , e ) ; respondFailure ( httpResponse , e . getHttpErrorCode ( ) , e . getErrorCode ( ) , e . getErrorText ( ) ) ; } catch ( Exception e ) { LOGGER . info ( "There was an issue executing the request." , e ) ; respondFailure ( httpResponse , 200 , ErrorCode . SYSTEM_GENERAL_ERROR , "General server errors occured while executing the request" ) ; } }
Builds a Request object.
Builds a Request object .