jQuery in Action, 2nd edition*
The moose likes JSP and the fly likes content-type issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "content-type issue" Watch "content-type issue" New topic
Author

content-type issue

Akhilesh Trivedi
Ranch Hand

Joined: Jun 22, 2005
Posts: 1526
I have a JSP page with content type set to
<%@ page contentType="application/vnd.ms-excel"%>. I also have some javascript code in it, but seems it is not working. Can I have script inside a JSP page of this kind?

Since i have set the content type, the page asks for "open or save dialog". I want to close the parent window (the IE) on clicking "save". However, the "open" option is working fine. Is it also possible to prevent the dialog-from getting displayed, and simply bypass to "open" option.


Keep Smiling Always — My life is smoother when running silent. -paul
[FAQs] [Certification Guides] [The Linux Documentation Project]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

If you're instructing the browser to open the content in a non-browser application, you would have to check the documentation of that application (in this case Excel) to see if it supports Javascript.

If you use the "inline" attribute of the Content-Disposition header tag, the browser will open the app up in the specified app, providing an app is registered for the given content type.

Search this forum for "Content-Disposition" if you want an example.


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

Joined: Jun 22, 2005
Posts: 1526
Thanks a lot for you response.Can you please suggest me a solution to my situation, where in i need to close the blank window that is left out when the user chooses 'save' in the dialog.
 
 
subject: content-type issue
 
Similar Threads
How to open the RTF format data in Netscape and IE
How to allow user to browse/provide local folder location/path for download
Problem in closing the browser
Displaying the File Download dialog box
Content type Issue