Frédéric FACHINETTI wrote:
Hello,
I have a portlet that query a database and then display
the resultset using some JSP's.
Now, I want to retrieve the query results not in html
format but in a zip file format ie when I submit the
query in my portlet I then have the "save as ..." window
and I'm able to retrieve the query results thru a zipped
text file.
I managed to do it in an old perl application by changing
the content-type and by printing the result in a zip stream.
But with java and Jetspeed, I have no idea if it's possible
and how to proceed.
Is there a content-type specific to each portlet ?
Nope, HTTP only defines a content-type for a whole response.
To do this within Jetspeed, you ned to define a new screen
template for example:
WEB-InF/conf/templates/vm|jsp/SendFile.vm:
$data.Response.setContentType("application/octet-stream")$file
create an action to set the "file" object in the context
to the ZIP file you want to send
in your portlet create a link to this screen like this:
<jetspeed-root>/template/SendFile/action/MySendAction.
This is standard Turbine stuff so you should probably
check out the Turbine documentation and mailing-list for
further examples of how to use the Turbine screen to
send non-HTML output.
--
Raphaël Luta - [EMAIL PROTECTED]
Apache Jetspeed - Enterpise Portal in Java
http://portals.apache.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]