File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hyperlinking files in a servlet

 
ramu av
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3150
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?
 
ramu av
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks balaji,

but the problem comes only in the servlets and not in the static pages.
 
ramu av
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks a lot balaji,

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

thanks again.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic