In general, I don't think that it's a good idea to create the file inside your web application's directory structure. For one thing, if you're using Java, the application's war file might not be exploded by the servlet container (preventing you from writing a file into the directory structure). For another thing, you probably do not want the file to disappear if you move in another version of your application, right?
I would recommend writing the file elsewhere when the request is made and then returning the contents of the file in response to a different request. If you're writing a Java web application, there are a number of ways to return the contents of a file; this link has a good list: http://istvandevai.com/techlife/entry/1001_ways_to_serve_static Tony -- Tony Strauss Designing Patterns, LLC http://www.designingpatterns.com http://blogs.designingpatterns.com On Apr 20, 2:39 pm, Neo <[email protected]> wrote: > The file will be created in response to a request. It will be created > everytime the request is made. > The file wont change much often. > > On Apr 20, 11:22 pm, Tony Strauss <[email protected]> > wrote: > > > Perhaps be a bit more specific about exactly what you're doing. Are > > you trying to create this file in response to a request? Are you > > instead trying to create this file before your web server starts? How > > often will this file change? > > > Tony > > -- > > Tony Strauss > > Designing Patterns, > > LLChttp://www.designingpatterns.comhttp://blogs.designingpatterns.com > > > On Apr 20, 11:58 am, Neo <[email protected]> wrote: > > > > Hi, > > > I am trying to create a file using some server side code. The file > > > gets created in the Project's root directory ? > > > Is there a way to create a file inside the public directory of the > > > application or atleast copy it to the public directory ? > > > > Once the file is created I want to read this file from my client side > > > code. Right now I am not able to do so as the client side code has no > > > access to resources outside the public directory :( > > > > Please help me out in this. > > > If you know of any better approach please tell me. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
