A URL that begins with "file://" only works on the local file system. It will not work on a server. This prefix should never be used in a web application. The only reason it worked with WSAD is that your server and browser were both on the same system.
Here are two possible solutions:
1- (Preferred) Don't output to a file at all. Simply retrieve the HttpServletResponse object's OutputStream using its getOutputStream() method and then write to it instead of the FileOutputStream. You would then set the content type using response.setContentType() method. Make sure you return null from the execute() method of your Action class to let
struts know that you've handled the response and don't need it to forward to a JSP.
2- Create a temporary file in the web application's context so that it is available to be downloaded. You can find the actual file path of the web context with the following statement:
String path = getServlet().getServletContext().getRealPath("/");
Once you have this path, you can write your file to it. The user can then access it the same as any other file in your context:
http://myserver.com/myApp/myfile.xls The advantage of option 1 over option 2 is that you're not cluttering up the disk of your server with files that you need to keep track of and clean up periodically.