yeeeeeeeah it works!!!!! thaks thaks thaks thaks thaks thaks thaks!!!! :D On Apr 8, 1:41 pm, HDayi <[email protected]> wrote: > hi andrew, > when you give only the file name, tomcat does not use your application > directory to access it. it uses it's own installation directory. so > you must use the exact path of the file or use ServletContext as i > mentioned abow. > shortly you must do fallowing: > for reading the file: > ServletContext sc = this.getServletConfig().getServletContext(); > InputStream is = sc.getResourceAsStream("/blabla.txt"); > BufferedReader input = new BufferedReader(new > InputStreamReader(is)); > > then you can acces your file correctly. > > while wrting the file: > ServletContext sc = this.getServletConfig().getServletContext(); > BufferedWriter out = new BufferedWriter(new > FileWriter(sc.getRealPath("/blabla.txt"))); > > if you are using linux, tomcat user must have read and write rights of > the file. > > good luck
-- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
