Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
I';在jsp中使用linux命令。。。但页面是无限加载的_Linux_Jsp_Command - Fatal编程技术网

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
正在等待密码