>    * map your servlet to /fileservlet/* (according to servlet spec 2.2)
>    * put a link in your page pointing to /fileservlet/foo.doc
>    * in the fileservlet call request.getPathInfo() to get the filename
("foo.doc")
>    * map the filename to the real filename and
>    * send back the real file (e.g via requestDispatcher.forward(), if the
file has
>      the correct extension or via include() if it does not. If it does not
you have
>      to set the content type manually with
>      response.setContentType(getServletContext().getMimeType(String
filename)))
>    * as the link pointed to /fileservlet/foo.doc, the browser will take
foo.doc as
>      filename.

This sounds like a nice plan.  If have to pass in additional parameters,
would I do it like this:

/fileservlet?id=4/foo.doc -- and have the parameters be processed
automatically, or

/fileservlet/foo.doc?id=4 -- and have to extract the ID string/value from
the path info?

Thanks,
David

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to