public HttpServletResponse execCmd(String cmd, HttpServletRequest request, HttpServletResponse response) throws IOException {

          StringBuffer output = new StringBuffer();
Process p = null;
try {
p = Runtime.getRuntime().exec(cmd);
p.waitFor(); BufferedReader reader =new BufferedReader(new InputStreamReader(p.getInputStream())); String line = ""; while( (line = reader.readLine()) != null) { output.append(line + "\n");
} } catch (Exception e) {
e.printStackTrace();
} PrintWriter pw = response.getWriter();
pw.write(output.toString()); return response; }

最新文章

  1. sublime下安装ctags
  2. Arguments Optional
  3. 【转】字符集和字符编码(Charset & Encoding)
  4. Zabbix利用msmtp+mutt发送邮件报警(公告:这文章有问题,还没有修改,2016-08-25)
  5. C#学习笔记(八)——定义类的成员
  6. 收集的55个Linux系统管理中常用的一些shell命令
  7. php的header()大全
  8. 实战项目:通过当当API将订单抓取到SAP(二)
  9. C# 解压zip压缩文件
  10. linux 分区、目录及用途
  11. SpringBoot cookie工具类
  12. 2017.11.7 ant design - upload 组件的使用, react 条件渲染以及 axios.all() 的使用
  13. 超高频RFID模块
  14. 通过ReentrantLock简单了解下并发包中的锁
  15. 优股社区logo
  16. 「HNOI 2016」 序列
  17. Elasticsearch技术解析与实战(七)Elasticsearch partial update
  18. centos7虚拟机克隆
  19. Java基本类型学习
  20. 5.3日,7:20开始 阮一峰js的早课学习

热门文章

  1. HDoj-1863-畅通project-并查集
  2. fatal error C1853: '<filename>' is not a precompiled header file
  3. (算法)Partition方法求数组第k大的数
  4. struts2基础梳理(二)
  5. Opencv2.4.9安装和在visualstudio 2013中配置
  6. poj 1879 Truck History
  7. from VC的IDE使用技巧大全
  8. 〖Linux〗VIM youcompleteme 自动补全 #include 文件名称
  9. HTTP协议详解之URL篇
  10. java中的finally详解(finally中没有return i,却有i=XX)