Our web application is deployed in a Solaris server. We need to be able to read word/excel files located in another file server(Win2000) and display to clients. Due to security considerations, the files should not be downloaded to the Solaris server for purposes of reading the contents. Is there any way of writing a servlet to read the file as a stream and display it to client ? Any sample code that anyone already has that achieves similar functionality would be great.
If you can write a URL to the doc/xls that you want to display in the servlet, then you can open a URLConnection to it and get an input stream. From that do what you want (copy it to the response output stream, or something else...):