This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Servlets and the fly likes Download using Servlet versus providing a link Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Servlets
Bookmark "Download using Servlet versus providing a link" Watch "Download using Servlet versus providing a link" New topic

Download using Servlet versus providing a link

C Vivek
Ranch Hand

Joined: Oct 03, 2004
Posts: 115
Dear All,
If I have a pdf document to be made available to users for a small intranet site. Can I just provide a link of that file directly using html-Href or should I be making a servlet for the same.
Are there any advantage of using the servlet?

Thanks in advance.
Martijn Verburg

Joined: Jun 24, 2003
Posts: 3275

You can provide a normal http:// reference yes. An advantage of doing it through a servlet is security (you can block access to users that you don't want to see the PDF, you're also 'hiding' any directory structure that people may try to exploit etc).

Hope that helps!

Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Download using Servlet versus providing a link
jQuery in Action, 3rd edition