hi ther,,,
when i try to run n compile this prg in browser it says Internal Server Error 500 java.lang.ClassNotFoundException: Unable to find class java.io.FilePermission
if i comment
FilePermission fp = new FilePermission("/test/test.txt","delete");
java.lang.NoSuchMethodError: java.io.File: method
getCanonicalFile()Ljava/io/File; not found
can anyone solve this problem ...
i have tested this code in Windows-2000 n Solaris...the webserver which i am using is JavaWebServer2.0....
(this code is perfectly working on console)
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class DemoTest extends HttpServlet {
public void service(HttpServletRequest req,HttpServletResponse res) {
try {
PrintWriter out = res.getWriter();
FilePermission fp = new FilePermission("/test/test.txt","delete");
File f = new File("/test/test.txt");
f = f.getCanonicalFile();
if(f.delete()){
out.println("File Deleted");
}else{
out.println("Error");
}
}catch(Exception e){
e.printStackTrace();
}
}
}
Rao
when i try to run n compile this prg in browser it says Internal Server Error 500 java.lang.ClassNotFoundException: Unable to find class java.io.FilePermission
if i comment
FilePermission fp = new FilePermission("/test/test.txt","delete");
java.lang.NoSuchMethodError: java.io.File: method
getCanonicalFile()Ljava/io/File; not found
can anyone solve this problem ...
i have tested this code in Windows-2000 n Solaris...the webserver which i am using is JavaWebServer2.0....
(this code is perfectly working on console)
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class DemoTest extends HttpServlet {
public void service(HttpServletRequest req,HttpServletResponse res) {
try {
PrintWriter out = res.getWriter();
FilePermission fp = new FilePermission("/test/test.txt","delete");
File f = new File("/test/test.txt");
f = f.getCanonicalFile();
if(f.delete()){
out.println("File Deleted");
}else{
out.println("Error");
}
}catch(Exception e){
e.printStackTrace();
}
}
}
Rao