• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

streaming an HTML document

 
john alexa
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hows it going everyone... i have quite the issue here... it seems simple enough but it has me stumped.

i have a document repository.... people can upload files into it, then click on the file name to view it.....

however, in the case that the user selects an HTML document i am running into some trouble:

it is opening on top of my current application, i have tried target="_blank" etc, etc... but the best ive gotten was for it to open a new blank page...

what i would like to happen is to simply have a new window pop up with the desired HTML document shown....



here is the code in the jsp:

<li <a class="docTree" onclick="document.documentTreeForm.filePath.value='" + currentID + "'; document.documentTreeForm.fileContent.value='" + currentFile.replace("'", "\\'") + "'; document.documentTreeForm.submitAction.value='viewFile'; document.documentTreeForm.submit();" target="" href="javascript: void(0);">" + currentFile + "</a></li>


i pass that into my action which locates the file within my database and sends the data to the following class to stream: (mind you, this works for every other type of document, and i dont have the exact path/location of the HTML document... so this is the only way i can retrieve the data)


if anyone has any help or hints im open to anything!

thanks a lot,
john
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65125
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your HTML is malformed. The <li is missing its >. (In fact, it looks like you just cut it out of some script?)

What are the content-type and content-disposition headers begin set to?
 
john alexa
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
bear,

my JSP code is actually fine, i just was trying to cut out some unneeded portions for my question and edited it poorly... and as you pointed out... i also forgot another chunk of code:



as you can see above.. i started off attempting to grab the file type but that didnt work any better, so for now everything gets the same content type.

*i should note, that this is only an issue for me in IE, firefox handles it differently.


thanks for your help!
-john
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic