aspose file tools*
The moose likes Servlets and the fly likes hyperlinking files in a servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "hyperlinking files in a servlet" Watch "hyperlinking files in a servlet" New topic
Author

hyperlinking files in a servlet

ramu av
Greenhorn

Joined: Feb 25, 2003
Posts: 28
hello

i'm not able to hyperlink the files with extensions other than .txt or .doc
or .html

if extension is .xls or .zip the file is displaying the files in binary format

the code is
out.println("<a href='/titans/something.xls>something</a>");

it works fine if i give the absolute path.

do i need to chand the content type??

somebody help me please.
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Have you tried setting MIME mappings in web.xml file ?
Example
Extension: pdf
MIME Type: application/pdf

is it only occuring in servlet or in static html files as well ?


Spritle Software Blogs
ramu av
Greenhorn

Joined: Feb 25, 2003
Posts: 28
thanks balaji,

but the problem comes only in the servlets and not in the static pages.
ramu av
Greenhorn

Joined: Feb 25, 2003
Posts: 28
thanks a lot balaji,

i tried what you had mentioned and my problem is solved.

thanks again.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: hyperlinking files in a servlet