• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

creating a file with servlet

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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......
 
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ...............
 
reply
    Bookmark Topic Watch Topic
  • New Topic