portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sami Leino" <sami.le...@netorek.fi>
Subject J1: serving binary files through a portlet?
Date Thu, 01 Apr 2004 14:09:24 GMT
I am building a small bulletin-board system which should support
attachments as well. For that, I would need to serve binary content from a
PortletAction or Portlet class. Is this possible with J1?

The procedure I should do is:

1) Set "content-disposition" header to contain the correct filename
2) Set "content-type" header to "application/octet-stream" or something
more accurate if the information is present in attachment metadata
3) Dump the content using a ServletOutputStream

I tried to do this within a PortletAction class, but Jetspeed has already
obtained a Writer prior to calling the PortletAction and therefore I
cannot obtain ServletOutputStream from HttpServletResponse. As you know,
Writer shouldn't be used for binary data because it may perform some
character encoding on the content, and it might break the attachments.

Do I need to create a separate servlet for serving the attachments? I
wouldn't want to do that, because Jetspeed offers authorization and I
would really like to fully utilize it.




Sami Leino
Software Developer
Netorek Oy

To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org

View raw message