extensions/http/src/main/java/uk/co/tfd/sm/http/batch/BatchServlet.java
@SuppressWarnings("unchecked")
	protected void batchRequest(HttpServletRequest request,
      HttpServletResponse response, boolean allowModify) throws IOException, ServletException {
    String json = request.getParameter(REQUESTS_PARAMETER);
    String template = request.getParameter(REQUEST_TEMPLATE);
    if ( template != null && template.length() > 0 ) {
    	if ( templateService.checkTemplateExists(template)) {
    		StringWriter processedTemplate = new StringWriter();
    		templateService.process(request.getParameterMap(), "UTF-8", processedTemplate, template);
    		json = processedTemplate.toString();
    	} else {
    		response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Template specified in request parameter t does not exist");
    	}
    }
    
    
    batchProcessor.batchRequest(request, response, json, allowModify);
  }
@SuppressWarnings("unchecked")
	protected void batchRequest(HttpServletRequest request,
      HttpServletResponse response, boolean allowModify) throws IOException, ServletException {
    String json = request.getParameter(REQUESTS_PARAMETER);
    String template = request.getParameter(REQUEST_TEMPLATE);
    if ( template != null && template.length() > 0 ) {
    	if ( templateService.checkTemplateExists(template)) {
    		StringWriter processedTemplate = new StringWriter();
    		templateService.process(request.getParameterMap(), "UTF-8", processedTemplate, template);
    		json = processedTemplate.toString();
    	} else {
    		response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Template specified in request parameter t does not exist");
    	}
    }
    
    
    batchProcessor.batchRequest(request, response, json, allowModify);
  }
@ SuppressWarnings ( "unchecked" ) protected void batchRequest ( HttpServletRequest request , HttpServletResponse response , boolean allowModify ) throws IOException , ServletException { String json = request . getParameter ( REQUESTS_PARAMETER ) ; String template = request . getParameter ( REQUEST_TEMPLATE ) ; if ( template != null && template . length ( ) > 0 ) { if ( templateService . checkTemplateExists ( template ) ) { StringWriter processedTemplate = new StringWriter ( ) ; templateService . process ( request . getParameterMap ( ) , "UTF-8" , processedTemplate , template ) ; json = processedTemplate . toString ( ) ; } else { response . sendError ( HttpServletResponse . SC_BAD_REQUEST , "Template specified in request parameter t does not exist" ) ; } } batchProcessor . batchRequest ( request , response , json , allowModify ) ; }
Takes the original request and starts the batching.

@param request
@param response
@throws IOException
@throws ServletException
Takes the original request and starts the batching .