• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

content-type issue

 
Akhilesh Trivedi
Ranch Hand
Posts: 1599
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Akhilesh Trivedi
Ranch Hand
Posts: 1599
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic