jsp调用服务器上的其他程序(C程序)
来源:互联网 发布:知乎每周精选232期 编辑:程序博客网 时间:2024/06/06 10:46
String area_dz=(String) req.getParameter("area");
String id_dz=(String) req.getParameter("id");
String ip ="10.xxx.x.xx";
String encodeSet = "export LC_CTYPE=zh_CN.GB18030;";
String cmd=". .bash_profile;./dz "+area_dz+" "+id_dz;//此处的dz为c程序编译后的文件
System.out.println(cmd);
ShellResult dz_result = RmtShellUtil
.exec(ip,
"user",
"password",
encodeSet
+ cmd, 60000);
req.setCharacterEncoding("UTF-8");
req.setAttribute("dz_result", dz_result.getOutStr());
String id_dz=(String) req.getParameter("id");
String ip ="10.xxx.x.xx";
String encodeSet = "export LC_CTYPE=zh_CN.GB18030;";
String cmd=". .bash_profile;./dz "+area_dz+" "+id_dz;//此处的dz为c程序编译后的文件
System.out.println(cmd);
ShellResult dz_result = RmtShellUtil
.exec(ip,
"user",
"password",
encodeSet
+ cmd, 60000);
req.setCharacterEncoding("UTF-8");
req.setAttribute("dz_result", dz_result.getOutStr());
System.out.println("1="+dz_result.getOutStr());
jsp调用访问时,可利用. .bash_profile;用来加载环境变量从而实现正常的调用,否则会报错
[./dz: error while loading shared libraries: libclntsh.so.11.1: cannot open shared object file: No such file or directory]
0 0
- jsp调用服务器上的其他程序(C程序)
- 程序调用其他程序
- Linux下C语言中调用其他程序的办法
- C#调用其他程序,比如控制别的程序上的按钮
- web服务调用服务器上程序的方法
- 服务器程序和数据库的定期备份,删除,传输到其他服务器上
- 调用其他程序
- VC++调用其他程序
- android 调用其他程序
- android 调用其他程序
- android 调用其他程序
- python调用其他程序
- VC中调用其他程序的函数
- Android程序里调用其他的APK
- Linux上的C程序不同文件调用
- 在当前程序中调用其他程序的Activity
- Android 程序中调用其他程序的方法总结
- Android apk程序调用其他的APK程序
- zTree $.fn.zTree is undefined 错误解决方法
- SQLite数据库中索引的使用、索引的优缺点
- spring组件及架构
- QQ邮箱查看好友/发件人IP地址
- tjut 3499
- jsp调用服务器上的其他程序(C程序)
- linux使用--9.grub各种引导的恢复
- 侧滑菜单
- MySQL之order by 优化(1)
- 银行卡三元素实名认证
- 事务!!事务!!
- radiogroup+radiobutton与viewpager购成页面
- linux使用--10.用gimp画图
- 那些年撸代码遇到的让人心酸bug-------ajax异步请求数据不成功