File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "content-type issue" Watch "content-type issue" New topic

content-type issue

Akhilesh Trivedi
Ranch Hand

Joined: Jun 22, 2005
Posts: 1599
I have a JSP page with content type set to
<%@ page contentType="application/"%>. 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

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: 1599
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.
I agree. Here's the link:
subject: content-type issue
It's not a secret anymore!