• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to create a file from servlet  RSS feed

 
Jason Adam Bourne
Greenhorn
Posts: 8
AngularJS Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,
I am a Java newbie, I want to use my servlet to create and store files.
I want to store files in /WEB-INF/SomeFolder/

I don't find how to create and store the files there. Please Help !
 
J. Kevin Robbins
Bartender
Posts: 1801
28
Chrome Eclipse IDE Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Show us what you've tried so far. What happened? What did you expect to happen? ShowSomeEffort
 
Ivan Jozsef Balazs
Rancher
Posts: 992
5
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is not forcibly a good idea to write under WEB-INF from the web application.
It is meant to be handled by the servlet container.
Theoretically it could serve the application from its war file without extracting it, so that WEB-INF could even still be located inside the archive.

If you want to write files somewhere, consider a configurable directory somewhere outside the deployed applications.
In a clustered environment it is problematic anyway.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!