public void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  log.info("From " + request.getRemoteHost() + " - "+ request.getRemoteAddr());
  HttpSession session=request.getSession(true);
  Properties ctx=JSPEnv.getCtx(request);
  response.setHeader("Cache-Control","no-cache");
  response.setContentType("text/xml; charset=UTF-8");
  response.setCharacterEncoding("UTF-8");
  PrintWriter out=response.getWriter();
  int expenseID=WebUtil.getParameterAsInt(request,"W_Expense_ID");
  int clientID=WebUtil.getParameterAsInt(request,"clientID");
  int campaignID=WebUtil.getParameterAsInt(request,"campaignID");
  int projectID=WebUtil.getParameterAsInt(request,"projectID");
  int phaseID=WebUtil.getParameterAsInt(request,"phaseID");
  int taskID=WebUtil.getParameterAsInt(request,"taskID");
  int orgID=WebUtil.getParameterAsInt(request,"orgID");
  int warehouseID=WebUtil.getParameterAsInt(request,"warehouseID");
  int partnerID=WebUtil.getParameterAsInt(request,"partnerID");
  String get=Util.maskHTML(request.getParameter("get"),true);
  if (get == null) {
    out.println("<error>Unknown Request: NULL</error>");
  }
 else   if (get.equalsIgnoreCase("clientList")) {
    outputClients(ctx,out,clientID,(expenseID == 0));
  }
 else   if (get.equalsIgnoreCase("orgList")) {
    outputOrgs(ctx,out,clientID,orgID,(expenseID == 0));
  }
 else   if (get.equalsIgnoreCase("campaignList")) {
    outputCampaigns(ctx,out,campaignID,(expenseID == 0));
  }
 else   if (get.equalsIgnoreCase("projectList")) {
    outputProjects(ctx,out,projectID,(expenseID == 0));
  }
 else   if (get.equalsIgnoreCase("phaseList")) {
    outputPhases(ctx,out,projectID,phaseID,(expenseID == 0));
  }
 else   if (get.equalsIgnoreCase("taskList")) {
    outputTasks(ctx,out,projectID,phaseID,taskID,(expenseID == 0));
  }
 else   if (get.equalsIgnoreCase("partnerList")) {
    outputPartners(ctx,out,partnerID,(expenseID == 0));
  }
 else   if (get.equalsIgnoreCase("warehouseList")) {
    outputWarehouses(ctx,out,orgID,warehouseID,(expenseID == 0));
  }
 else   if (get.equalsIgnoreCase("priceList")) {
    outputPriceLists(ctx,out,(expenseID == 0));
  }
 else {
    out.println("<error>Unknown Request: " + get + "</error>");
  }
  out.flush();
  out.close();
}

public void doPost ( HttpServletRequest request , HttpServletResponse response ) throws ServletException , IOException { log . info ( "From " + request . getRemoteHost ( ) + " - " + request . getRemoteAddr ( ) ) ; HttpSession session = request . getSession ( true ) ; Properties ctx = JSPEnv . getCtx ( request ) ; response . setHeader ( "Cache-Control" , "no-cache" ) ; response . setContentType ( "text/xml; charset=UTF-8" ) ; response . setCharacterEncoding ( "UTF-8" ) ; PrintWriter out = response . getWriter ( ) ; int expenseID = WebUtil . getParameterAsInt ( request , "W_Expense_ID" ) ; int clientID = WebUtil . getParameterAsInt ( request , "clientID" ) ; int campaignID = WebUtil . getParameterAsInt ( request , "campaignID" ) ; int projectID = WebUtil . getParameterAsInt ( request , "projectID" ) ; int phaseID = WebUtil . getParameterAsInt ( request , "phaseID" ) ; int taskID = WebUtil . getParameterAsInt ( request , "taskID" ) ; int orgID = WebUtil . getParameterAsInt ( request , "orgID" ) ; int warehouseID = WebUtil . getParameterAsInt ( request , "warehouseID" ) ; int partnerID = WebUtil . getParameterAsInt ( request , "partnerID" ) ; String get = Util . maskHTML ( request . getParameter ( "get" ) , true ) ; if ( get == null ) { out . println ( "<error>Unknown Request: NULL</error>" ) ; } else if ( get . equalsIgnoreCase ( "clientList" ) ) { outputClients ( ctx , out , clientID , ( expenseID == 0 ) ) ; } else if ( get . equalsIgnoreCase ( "orgList" ) ) { outputOrgs ( ctx , out , clientID , orgID , ( expenseID == 0 ) ) ; } else if ( get . equalsIgnoreCase ( "campaignList" ) ) { outputCampaigns ( ctx , out , campaignID , ( expenseID == 0 ) ) ; } else if ( get . equalsIgnoreCase ( "projectList" ) ) { outputProjects ( ctx , out , projectID , ( expenseID == 0 ) ) ; } else if ( get . equalsIgnoreCase ( "phaseList" ) ) { outputPhases ( ctx , out , projectID , phaseID , ( expenseID == 0 ) ) ; } else if ( get . equalsIgnoreCase ( "taskList" ) ) { outputTasks ( ctx , out , projectID , phaseID , taskID , ( expenseID == 0 ) ) ; } else if ( get . equalsIgnoreCase ( "partnerList" ) ) { outputPartners ( ctx , out , partnerID , ( expenseID == 0 ) ) ; } else if ( get . equalsIgnoreCase ( "warehouseList" ) ) { outputWarehouses ( ctx , out , orgID , warehouseID , ( expenseID == 0 ) ) ; } else if ( get . equalsIgnoreCase ( "priceList" ) ) { outputPriceLists ( ctx , out , ( expenseID == 0 ) ) ; } else { out . println ( "<error>Unknown Request: " + get + "</error>" ) ; } out . flush ( ) ; out . close ( ) ; }
process the http post request .
