JSF-file download

On clicking a link on my page i want to download the doc file. The jsp page containing jsf & html tags are displayed inside a portlet. i tried using myfaces file upload but it was showing error when i deployed & run the file. i tried using html <a href >also.the doc file which i want 2 download is outside my web application folder. plezse help...

[366 byte] By [spicy-pinka] at [2007-11-27 11:02:34]
# 1

> the doc file which i want to download is outside my web application folder

Create a FileServlet, pass the file name as parameter, do some validations on the parameter, set the headers, stream the file to the response.getOutputStream() and you're fine.

Googling using the keyword "fileservlet" should give enough hits.

BalusCa at 2007-7-29 12:44:14 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...