Originally posted by Sebastian Green:
To make the txt file I have to define the whole path like C:\tomcat\webapps\mywebapp\file.txt.
Any particular reason why? Files, FileOutputStreams and FileWriters can take relative paths in
Java, so you could make the file path relative to your
servlet's home directory. You could also make use of File's static createTempFile() methods to utilize the platform-specific temp directory.