Only 44 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

creating a file with servlet  RSS feed

 
anirudh takkallapally
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi!! ,
i have loaded tomcat server on to my local machine and i am running my servlets on that. i have written a servlet to create a file , i am calling this servlet from a applet ,it is working fine on my server , but when i loaded it onto another tomcat server which is the main server which hosts websites , i am not able to create a file , the communication between the applet and servle and the applet is fine ,
try {
File outputFile = new File("window_surf_test");
FileOutputStream fos = new FileOutputStream(outputFile);
PrintWriter pwriter = new PrintWriter(fos);
pwriter.println(stringValue1);
pwriter.println(stringValue2);
pwriter.println(stringValue3);
//pwriter.println(f);
System.out.println( " Check the result: " + stringValue2 );
pwriter.close();
fos.close();
} catch (FileNotFoundException e) {
System.err.println("FileStreamsTest: " + e);
}

this is the code i am using to create the file , please tell me what could be the possable reason for not creating the file on the other server
are there any security issues that have to be resolved....
another question , where exactly is the file created??? i mean the path..
thanks......
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it throwing any exception? How about trying to catch Exception (a more generic one) and see if it's throwing some useful error.
 
anirudh takkallapally
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am not getting the terminal window for the server on the machine
, is there a way to look for the exceptions that are generated ??? ,
please help me out here..
thanks ...............
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!