Пример #1
0
 protected StandardCallInfo processFunctionalRequest(HttpServletRequest req)
     throws UnsupportedEncodingException, IOException, ServletException {
   StandardCallInfo ret = new StandardCallInfo();
   Properties props = getParams(req);
   ret.setFunctionName(props.getProperty("FUNCTION"));
   ret.setContent(props.getProperty("PARAMS"));
   log.debug("Function is " + ret.getFunctionName());
   return ret;
 }
Пример #2
0
  @Override
  public void doPost(HttpServletRequest req, HttpServletResponse resp)
      throws IOException, ServletException {
    StandardCallInfo call = processFunctionalRequest(req);
    DispatchDecisionFunction decisionDispatch =
        DispatchDecisionFunction.valueOf(call.getFunctionName());
    DispatchReturn response;
    try {
      response = decisionDispatch.executeDispatch(call.getContent(), req, resp);
    } catch (Exception e) {
      response = handleUnexpectedException(e);
    }

    // Send the response and we're done

    sendResponseAppropriately(response.getContext(), req, resp, response.getResponse());
  }