A
Albretch
WHy is it that a code segment like this works fine for a servlet, but not in a JSP?
// __
String aLn;
Process p;
// __ aRealPath=C:\LIUWBT\ROOT\
String aRealPath = SCtxt.getRealPath("/");
System.err.println(" aRealPath=" + aRealPath);
String[] aAr = new String[]{"cmd.exe", "/c", "dir", aRealPath};
try{
// __
p = Runtime.getRuntime().exec(aAr);
// __
DataInputStream DIS = new DataInputStream(p.getInputStream());
BufferedReader BR = new BufferedReader(new InputStreamReader(DIS));
while ((aLn = BR.readLine()) != null) { System.err.println(aLn); }
// __
}catch(IOException i) { i.printStackTrace(); }
// __
String aLn;
Process p;
// __ aRealPath=C:\LIUWBT\ROOT\
String aRealPath = SCtxt.getRealPath("/");
System.err.println(" aRealPath=" + aRealPath);
String[] aAr = new String[]{"cmd.exe", "/c", "dir", aRealPath};
try{
// __
p = Runtime.getRuntime().exec(aAr);
// __
DataInputStream DIS = new DataInputStream(p.getInputStream());
BufferedReader BR = new BufferedReader(new InputStreamReader(DIS));
while ((aLn = BR.readLine()) != null) { System.err.println(aLn); }
// __
}catch(IOException i) { i.printStackTrace(); }