Skip to main content

Where to store generated images?

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
1 reply [Last post]
ajvok
Offline
Joined: 2010-02-26

I have an glassfish app that generates images depending on user request.
These images are then delivered back to the user via <img> tags.
Where is a sensible place to store generated files like this?
Currently they are in the application directory, but they get deleted whenever I upgrade and deploy a new version of the app.
I want them to survive re-deployment & be resused without having to generate the images again.
It is not clear to me how I can access them via <img> tags if they are outside the application directory.
Apologies if this is a really dumb question, but any help would be much appreciated.
Thanks.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ajvok
Offline
Joined: 2010-02-26

OK, I've just discovered "alternatedocroot_1" which seems to do the trick.
sun-web.xml
<property name="alternatedocroot_1" value="from=/images/* dir=/mydatadir"/>