zoukankan      html  css  js  c++  java
  • 接收xml请求流并解析字符串的例子

     //接收请求发来的xml消息体,并返回xml字符串
    public static String recieveData(HttpServletRequest request)
        {
           
            String inputLine = null;
            // 接收到的数据
            StringBuffer recieveData = new StringBuffer();
           
            BufferedReader in = null;
            try
            {
                in = new BufferedReader(new InputStreamReader(
                        request.getInputStream(), "UTF-8"));
                while ((inputLine = in.readLine()) != null)
                {
                    recieveData.append(inputLine);
                }
            }
            catch (IOException e)
            {
            }
            finally
            {
               
                try
                {
                    if (null != in)
                    {
                        in.close();
                    }
                }
                catch (IOException e)
                {
                }
               
            }
           
            return recieveData.toString();
        }

  • 相关阅读:
    左旋转字符串
    swoole(8)http服务
    整数反转
    两数之和
    广度优先搜索
    快速排序
    JavaScript当中的eval函数
    JavaScript中的作用域链原理
    git push和git pull
    cherry-pick,revert和rebase使用的3-way合并策略
  • 原文地址:https://www.cnblogs.com/qqzy168/p/3136962.html
Copyright © 2011-2022 走看看