.jsp
<%@ page import = "java.io.File"%>
<%@ page import = "java.io.*"%>
<%
String dir = "/var/lib/tomcat7/webapps/Venu"
Process p = Runtime.getRuntime().exec("ImageConversion.py download.jpg", null, dir);
p.waitFor();
BufferedReader reader=new BufferedReader(new InputStreamReader(p.getInp$
String line=reader.readLine();
while(line!=null)
{
System.out.println(line);
line=reader.readLine();
}
%>
ImageConversion.py
<%@ page import = "java.io.File"%>
<%@ page import = "java.io.*"%>
<%
String dir = "/var/lib/tomcat7/webapps/Venu"
Process p = Runtime.getRuntime().exec("download.jpg", null, dir);
p.waitFor();
BufferedReader reader=new BufferedReader(new InputStreamReader(p.getInp$
String line=reader.readLine();
while(line!=null)
{
System.out.println(line);
line=reader.readLine();
}
%>
我正在尝试使用JSP调用python脚本,但是jsp代码显示错误,我们如何从jsp调用系统命令。 提前谢谢。