This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach 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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Download using Servlet versus providing a link" Watch "Download using Servlet versus providing a link" New topic
Author

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
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Download using Servlet versus providing a link
 
Similar Threads
GUI based webserver servlet access
Download link
Problem with IceFaces
URGENT HELP NEEDED
*.faces suffix mapping