T
tiewknvc9
Hi!
I created a single jsp page that is just supposed to create a new jsp
file in the current directory. I put together this code (see below),
this code will always put the file in the "bin" directory...
Disallowing me to access it again with my application.
I would like it to create the file in the Same directory as the jsp
page... but I dont know how.
If you copy and paste this into a jsp page, and run it... you should
see my problem in action.
Thanks in advance!
<%@page import="java.io.*"%>
<%
String curDir = System.getProperty("user.dir");
File filFile = new File(curDir + "\\pleaseWork.txt");
boolean success = filFile.createNewFile();
if (success){
out.print("created new file" + curDir + "\\pleaseWork.txt");
}else{
out.print("updated file" + curDir + "\\pleaseWork.txt");
}
%>
I created a single jsp page that is just supposed to create a new jsp
file in the current directory. I put together this code (see below),
this code will always put the file in the "bin" directory...
Disallowing me to access it again with my application.
I would like it to create the file in the Same directory as the jsp
page... but I dont know how.
If you copy and paste this into a jsp page, and run it... you should
see my problem in action.
Thanks in advance!
<%@page import="java.io.*"%>
<%
String curDir = System.getProperty("user.dir");
File filFile = new File(curDir + "\\pleaseWork.txt");
boolean success = filFile.createNewFile();
if (success){
out.print("created new file" + curDir + "\\pleaseWork.txt");
}else{
out.print("updated file" + curDir + "\\pleaseWork.txt");
}
%>