古越剑箫

学习是一种习惯

  :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: :: 管理 ::

 

 

logger.info("销帐完成通知回调,请求URL:"+req.getRequestURI().toString());

InputStream in = req.getInputStream();
byte[] b=new byte[1024];
ByteArrayOutputStream  out=new ByteArrayOutputStream();
int len=-1;
while((len=in.read(b))!=-1){
    out.write(b,0,len);
}
out.close();
in.close();
String strVal= new String(out.toByteArray(),"UTF-8");

logger.info("销帐完成通知回调,请求参数-流形式:"+strVal);
Map parameterMap = req.getParameterMap();
Iterator entries = parameterMap.entrySet().iterator();
String name = "";
String value = "";
String  strFormValue="";
while (entries.hasNext()) {
    Map.Entry entry = (Map.Entry) entries.next();
    name = (String) entry.getKey();
    Object valueObj = entry.getValue();
    if(null == valueObj){
        value = "";
    }else if(valueObj instanceof String[]){
        String[] values = (String[])valueObj;
        for(int i=0;i<values.length;i++){
            value = values[i] + ",";
        }
        value = value.substring(0, value.length()-1);
    }else{
        value = valueObj.toString();
    }
    strFormValue+=name+"----"+value+"-";
}
logger.info("销帐完成通知回调,请求参数-form形式:"+strFormValue);
logger.info("销帐完成通知回调,请求参数-拼接形式:"+req.getQueryString());
logger.info("销帐完成通知回调,时间为:"+DateTime.now().toString("yyyyMMdd HHmmss"));
System.out.println("支付完成回调....");

 

  

 

posted on 2017-03-09 14:48  古越剑箫  阅读(384)  评论(0编辑  收藏  举报