This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Tomcat and the fly likes hyperlink html opening as save as instead of opening in IE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » Tomcat
Bookmark "hyperlink html opening as save as instead of opening in IE " Watch "hyperlink html opening as save as instead of opening in IE " New topic
Author

hyperlink html opening as save as instead of opening in IE

kamesh aru
Ranch Hand

Joined: Mar 16, 2002
Posts: 150
using tomcat 6 html hyperlinks when clicked prompting open/save as /cancel dilaog box instead of opening in browser.
thanks in advance
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Can you post the code to your hyperlink?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
kamesh aru
Ranch Hand

Joined: Mar 16, 2002
Posts: 150
its a redirection to another page

title="Automated LMS notifications sent in error" href="http://localhost:8080/portal/server.pt/document/528/doc_to_open">TEST DOC

the above line is opened with a and closed with a


[Thumbnail for open_dialog_box.JPG]

Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

On the server side, how are you delivering this document?
Are you using requestDispatcher.forward?
Are you streaming the document?
Or, are you just adding the document name to the URL and letting Tomcat's default servlet stream it?

Is "doc_to_open" just something you added when posting here or was that part of an actual URL?


Does this same behavior occur with other browsers, like FireFox?
kamesh aru
Ranch Hand

Joined: Mar 16, 2002
Posts: 150

doc_to_open = 20080103WC_01.html


This occurs in all browsers in firefox it downloads the file and opens it.

yes just adding the document name to the URL and letting Tomcat's default servlet stream it
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

That's odd.

Do you have either the LiveHttpHeaders or the FireBug plugin installed in Firefox?
If you do, can you look at the headers and see if the server is sending a Content-Type header?
If it is, what is its value?

kamesh aru
Ranch Hand

Joined: Mar 16, 2002
Posts: 150
yes checked the http headers
content-disposition is attachment ... how to over ride it on the tomcat server any configuration we can make to change it to inline.. i suppose which might open it with out the dialog box.

Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

I'm not seeing this behavior in Tomcat 6 on my machine.
Can you try running this small application and see if the same behavior exists?
http://www.souther.us/att.war
If not, can you create a small application that reproduces this problem and make it available for download?



kamesh aru
Ranch Hand

Joined: Mar 16, 2002
Posts: 150
following link helped in writing a filter to replace attachment with inline
servlet filter
thanks for the responces
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

If it were me, I'd track down the problem with the server before adding a filter to my project.
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
He possibly changed Tomcat´s default web.xml and/or override the mime mapping of HTML in the web.xml of his own webapp.
 
GeeCON Prague 2014
 
subject: hyperlink html opening as save as instead of opening in IE