You can configure an additional empty WAR directory in deploy - say uploads.war. Anything you place in there will be accessed as http://localhost:8080/uploads/*. This assumes that your existing web applications have not already reserved the URL.
Pass to the servlet that saves the file an initparam that specifies the absolute directory location for the upload storage. Obviously you can programmatically hard code it, but having an initparam in the deployment descriptor allows the deployment engineer to deal with it, not the programmer.
Save the file, dealing with the appropriate things problems such as multiple users and so on - use the passed parameter to target the save location.
Hope that makes sense.
Thanks ... I'll give that a try.
Wouldn't it be a bit more conventional to get JBoss/Tomcat working with Apache then just dump the files in docroot?
That's what I'm trying to figure out now -- reading TONS of messages here from people trying the same ... so much material but no real cookbook on how to do it successfully.
You can dump it in the Apache docroot if you are using Apache as a front-end. However, in most cases, the front-end is usually not on the same hardware so this becomes problematic as a general solution.
For your case where everything is on the same boxen, you can write directly to the Apache docroot directory or a subdirectory, thereof. The same technique applies. Just ensure that permissions for writing are adequate.
BTW, this works great. I can serve static content without the need for Apache. Thanks. I'd never have thought of faking a war as a directory ... the only thing I really needed to do was to add a WEB-INF directory with a jboss-web.xml .