I';在jsp中使用linux命令。。。但页面是无限加载的
我的消息来源如下I';在jsp中使用linux命令。。。但页面是无限加载的,linux,jsp,command,Linux,Jsp,Command,我的消息来源如下 <%@ page language="java" import= "java.io.*,java.util.*" contentType="text/html;charset=EUC-KR" session="false" %> <html> <% try{ Process ps = null; ps = Runtime.getRuntime().exec(new String[]{"su","ec2-user"}); ps.waitF
<%@ page language="java"
import= "java.io.*,java.util.*"
contentType="text/html;charset=EUC-KR" session="false"
%>
<html>
<%
try{
Process ps = null;
ps = Runtime.getRuntime().exec(new String[]{"su","ec2-user"});
ps.waitFor();
ps = Runtime.getRuntime().exec(new String[]{"cd"});
ps.waitFor();
ps = Runtime.getRuntime().exec(new String[]{"mkdir","/home/ec2-user/hello"});
ps.waitFor();
}catch(IOException ie){
ie.printStackTrace();
}catch(Exception e){
e.printStackTrace();
}
%>
</html>
当它被执行时,页面被无限加载
为什么不能使用此命令
ps=Runtime.getRuntime().exec(新字符串[]{“su”,“ec2 user”}) 只是黑暗中的一个镜头:也许
su
正在等待密码