Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Rendering an MS Excel file in a web browser using Java without prompting

807591Mar 11 2008 — edited Mar 11 2008
Hi,

I am trying to render a MS Excel file in a web browser using a Servlet. This is something like showing an excle report on clicking a button.

I have set the content type appropriately and set the Content-Disposition to 'inline'. But still i am getting the Open/Save prompt.

Is there a way in Java to directly open the excel file in the browser with out promting for Open or Save?

Here is my code,

response.setContentType("application/xls");//
response.setContentLength(baos.size());
response.setHeader(
"Content-Disposition",
"inline; filename=test.xls" );

Thanks,
LakshmiNarayanan.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 8 2008
Added on Mar 11 2008
3 comments
1,362 views