<bean:write name="myForm" property="content"/>

where content is defined as a bte array.
I am pretty certain that the contentType is specified correctly, since I
saw several examples of servlets that worked with PDF correctly and
specified the mime type the same way.



Please respond to "Struts Users Mailing List"
<[EMAIL PROTECTED]>
To:     "Struts Users Mailing List" <[EMAIL PROTECTED]>
cc:

Subject:        RE: Can someone help with this??? Using bean:write to
display/stream PDF
content



>The problem is: what is the type of the attribute in the form bean? If I
>use byte array, it fails -- just displays the address of the array in

How are you writing out the byte array? Also, I'm no PDF expert but are we
sure the content-type is specified correctly? Meaning is "application/pdf"
exactly correct?

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 23, 2003 10:54 AM
To: Struts Users Mailing List
Subject: RE: Can someone help with this??? Using bean:write to
display/stream PDF content




The problem is: what is the type of the attribute in the form bean? If I
use byte array, it fails -- just displays the address of the array in
memory as a string on the screen. If I use String attribute in the form
bean and convert my pdf byte array into a string by doing this str = new
String(byteArray), then it does not convert properly and my browser hangs.
I did set the content type to "application/pdf" on top of the JSP. Any
suggestions how to make this work?



Please respond to "Struts Users Mailing List"
<[EMAIL PROTECTED]>
To:     "Struts Users Mailing List" <[EMAIL PROTECTED]>
cc:

Subject:        RE: Can someone help with this??? Using bean:write to
display/stream PDF
content



I think in a previous post someone mentioned setting the content-type of
the
page to be that of a PDF document, then you write the stream back to the
client from the JSP.  The client will handle launching the appropritae
viewer.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 23, 2003 10:37 AM
To: [EMAIL PROTECTED]
Subject: Can someone help with this??? Using bean:write to
display/stream PDF content



Are there any struts gurus here that can help me? I did not get a single
answer to this question. If there was a solution to this question, it
would help many people that are working with portlets, like me, who can
use JSP and cannot use servlets durectly to stream binary content to the
browser. Thanks.

----------------- Forwarded by Leonard Reinstein/NY/ONE on 07/23/2003
10:34
AM ---------------------------
From:   Leonard Reinstein on 07/22/2003 09:18 PM
To:     [EMAIL PROTECTED]
cc:

Subject:        Using bean:write to display/stream PDF content -- please
help.


I would like to be able to display/stream the PDF file in the browser and
use the <bean:write> tag in the JSP to acomplish that.
Say I have a form bean that has a byte array field, and I want the jsp to
specify the contentType as "application/pdf" and just have the bean:write
tag, such as:

<bean:write name="mybean" property="pdfcontent"/>

Is this possible to achieve? Are there any hacks/tricks to make it work in
a JSP when the form bean has the binary content field?

When I do it with with the byte array attribute, it just displays the
address of the array in memory (possibly calls toString()). If I make the
field of type String and convert the byte array to String in the
controller as follows: str = new String(byteArray),  it does not get
converted correctly and the browser hangs.

I know the best way to do it is to have a servlet. But I need to do it in
a JSP because of certain limitations of my application. Please help.

Thanks.







This transmission may contain information that is privileged, confidential
and/or exempt from disclosure under applicable law. If you are not the
intended recipient, you are hereby notified that any disclosure, copying,
distribution, or use of the information contained herein (including any
reliance thereon) is STRICTLY PROHIBITED. If you received this
transmission
in error, please immediately contact the sender and destroy the material
in
its entirety, whether in electronic or hard copy format. Thank you.


---------------------------------------------------------------------
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]







This transmission may contain information that is privileged, confidential
and/or exempt from disclosure under applicable law. If you are not the
intended recipient, you are hereby notified that any disclosure, copying,
distribution, or use of the information contained herein (including any
reliance thereon) is STRICTLY PROHIBITED. If you received this
transmission
in error, please immediately contact the sender and destroy the material
in
its entirety, whether in electronic or hard copy format. Thank you.


---------------------------------------------------------------------
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]







This transmission may contain information that is privileged, confidential and/or 
exempt from disclosure under applicable law. If you are not the intended recipient, 
you are hereby notified that any disclosure, copying, distribution, or use of the 
information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. 
If you received this transmission in error, please immediately contact the sender and 
destroy the material in its entirety, whether in electronic or hard copy format. Thank 
you.


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

Reply via email to