• Post Reply Bookmark Topic Watch Topic
  • New Topic

Regarding opening a xml file in a jsp

 
yakkala krishna
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi this is rama krishnna.y.

I want to open a xml file through jsp by clicking a button.so i have written the following jsp program.but i have getting javascript error when i run this application.

But if i save this file in html format.and i run this file.it is working.the files are going to be opened when i click the button.

But i am not understanding why problem occuring in case of jsp.

please give me a suggestion why its giving error in jsp.


window.open("C:\test\test.xml")
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


This will only work if the user is sitting at a brower on the machine with your web server. If you want your users to be able to open files on your server, you need to place them inside your webapp and build a URL relative to the root of your context path. Another alternative is to build a servlet that can read the file from your server's hard drive and stream the file to the browser.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!