• Post Reply Bookmark Topic Watch Topic
  • New Topic

opening a pdf in browser

 
satheesh subramani
Greenhorn
Posts: 29
Fedora Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<a href="d:\jsp.pdf">view</a> this is not working
but jsp.pdf is within the web application ( href="jsp.pdf" ) is fine.

The problem is when i run the program the url is always start with http:\localhost\
so if i give ( href="d:\jsp.pdf") like this the url is http:\localhost\d:\jsp.pdf
how to resolve this please help me
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't use a file path to reference the pdf file. When the user's browser sees the file path, it can't access your system to fetch it, can it?

The file must be part of the web app, and it must be addressed using a server-relative URL that starts with the context path of the web app. See the JSP FAQ for more info.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!