RE: How To Render Binary Output - spreadsheet - from Struts

2003-06-25 Thread El Harouchi, Jaafar [IT]
And I highly recommend first doing:
response.reset();
if you are using HTTPS.
-jaafar

-Original Message-
From: Hookom, Jacob [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 25, 2003 4:47 PM
To: 'Struts Users Mailing List'
Subject: RE: How To Render Binary Output - spreadsheet - from Struts


Also, you will want to set some headers too:

response.setHeader("Content-Disposition","attachment;filename=\"" + fileName
+ "\"");

This will prompt the person to download the file (basically automates the
save as).  I just finished doing the same thing for a project and we wanted
to remove the confusion about what to save and what the file name was, etc.

-Jacob Hookom

-Original Message-
From: Michael Remijan [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 25, 2003 1:59 PM
To: Struts Users Mailing List
Subject: RE: How To Render Binary Output - spreadsheet - from Struts

Make a servlet call, then set the response content type as

response.setContentType("application/vnd.ms-excel");

and then write the contents of the excel spreedsheet the the reponse output
stream.  If you have a hyperlink on a jsp page that has an href like this:

  http://localhost/context/do-export-mapping

then by setting the content type above will cause excel to open
automatically.

Mike

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: How To Render Binary Output - spreadsheet - from Struts

2003-06-25 Thread Hookom, Jacob
Also, you will want to set some headers too:

response.setHeader("Content-Disposition","attachment;filename=\"" + fileName
+ "\"");

This will prompt the person to download the file (basically automates the
save as).  I just finished doing the same thing for a project and we wanted
to remove the confusion about what to save and what the file name was, etc.

-Jacob Hookom

-Original Message-
From: Michael Remijan [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 25, 2003 1:59 PM
To: Struts Users Mailing List
Subject: RE: How To Render Binary Output - spreadsheet - from Struts

Make a servlet call, then set the response content type as

response.setContentType("application/vnd.ms-excel");

and then write the contents of the excel spreedsheet the the reponse output
stream.  If you have a hyperlink on a jsp page that has an href like this:

  http://localhost/context/do-export-mapping

then by setting the content type above will cause excel to open
automatically.

Mike

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: How To Render Binary Output - spreadsheet - from Struts

2003-06-25 Thread Michael Remijan
Make a servlet call, then set the response content type as

response.setContentType("application/vnd.ms-excel");

and then write the contents of the excel spreedsheet the the reponse output stream.  
If you have a hyperlink on a jsp page that has an href like this:

  http://localhost/context/do-export-mapping

then by setting the content type above will cause excel to open automatically.

Mike

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How To Render Binary Output - spreadsheet - from Struts

2003-06-25 Thread douglas reames
Thanks Dan.

Problem is though, sometimes my clients want their Excel spreadsheets.  If 
you have any advise on how to output a binary stream from JSP - such as that 
which would be produced by POI - I would be grateful to hear it.

The User Guide ( 3.4.4 Image Rendering Components ) provides some guidance 
on rendering binary images:  "Render a hyperlink with a URL that executes a 
servlet request. The servlet will use a graphics library to render the 
graphical image ...".  I am afraid I am missing the boat here, if they are 
talking about rendering 'on the fly'.

regards,
Doug Reames

From: "Dan Tran" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Subject: Re: How To Render Binary Output  - spreadsheet - from Struts
Date: Wed, 25 Jun 2003 11:40:39 -0700
use display tag, it can do it for you transparently

http://edhill.its.uiowa.edu/display/

-Dan

- Original Message -
From: "douglas reames" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, June 25, 2003 11:24 AM
Subject: How To Render Binary Output - spreadsheet - from Struts
> I need to render a POI constructed spreadsheet on the fly.
>
> With Struts I can:
> [1] [ Action / Business Bean ] dynamically design - based on user's
> selections,
> [2] [ JSP ] construct a java file,
> [3] [ JSP ] compile the java file.
> [4] [ JSP ] execute the class file
>
> Will JSP output a Byte Array to the Response output stream?
>
> regards,
> Douglas Reames
>
> _
> Add photos to your messages with MSN 8. Get 2 months FREE*.
> http://join.msn.com/?page=features/featuredemail
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: How To Render Binary Output - spreadsheet - from Struts

2003-06-25 Thread Dan Tran
use display tag, it can do it for you transparently

http://edhill.its.uiowa.edu/display/

-Dan

- Original Message - 
From: "douglas reames" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, June 25, 2003 11:24 AM
Subject: How To Render Binary Output - spreadsheet - from Struts


> I need to render a POI constructed spreadsheet on the fly.
> 
> With Struts I can:
> [1] [ Action / Business Bean ] dynamically design - based on user's 
> selections,
> [2] [ JSP ] construct a java file,
> [3] [ JSP ] compile the java file.
> [4] [ JSP ] execute the class file
> 
> Will JSP output a Byte Array to the Response output stream?
> 
> regards,
> Douglas Reames
> 
> _
> Add photos to your messages with MSN 8. Get 2 months FREE*.  
> http://join.msn.com/?page=features/featuredemail
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How To Render Binary Output - spreadsheet - from Struts

2003-06-25 Thread douglas reames
I need to render a POI constructed spreadsheet on the fly.

With Struts I can:
[1] [ Action / Business Bean ] dynamically design - based on user's 
selections,
[2] [ JSP ] construct a java file,
[3] [ JSP ] compile the java file.
[4] [ JSP ] execute the class file

Will JSP output a Byte Array to the Response output stream?

regards,
Douglas Reames
_
Add photos to your messages with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?page=features/featuredemail

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]