为什么在WEB下就不能生成.txt文件??郁闷!!
这是我本地的测试代码,没有问题.可以创建文件.并且写入文字
public class test
{
OP_File o=new OP_File();
public void show()
{
o.writefile("log/aaa.txt","\n数据库完成于",true);
}
public static void main(String args[]){
test t=new test();
t.show();
o=null;
}
}
但是我做到servlet里面就行啊.为什么??看下我的代码:
public class test extends HttpServlet {
OP_File o= new OP_File();
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<head>");
out.println("<title>IVR PUSH</title>");
out.println("</head>");
out.println("<body>");
o.writefile("log/aaa.txt","\n数据库完成于",true);
out.println
("</body>");
out.println("</html>");
out.close();
o=null;
}
什么提示也没有,就是生成不了..为什么啊??