This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Servlets and the fly likes hyperlinking files in a servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply 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://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: hyperlinking files in a servlet
 
Similar Threads
SVG slidetool
Logging ..adivse
Send and Receive Binary Data in XML
XStream --> getting "id=someId"
not logging as coded