You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Adam Winer (JIRA)" <de...@myfaces.apache.org> on 2007/06/19 01:53:26 UTC

[jira] Commented: (TRINIDAD-52) Add actionListener to make sending files easy

    [ https://issues.apache.org/jira/browse/TRINIDAD-52?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12505979 ] 

Adam Winer commented on TRINIDAD-52:
------------------------------------

Implemented tr:fileDownloadActionListener tag, with contentType, filename, and method attributes.
Tag is documented and demo'd, but does need a Facelets tag.

> Add actionListener to make sending files easy
> ---------------------------------------------
>
>                 Key: TRINIDAD-52
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-52
>             Project: MyFaces Trinidad
>          Issue Type: New Feature
>    Affects Versions: 1.0.0-incubating-core
>            Reporter: Adam Winer
>            Assignee: Adam Winer
>
> Currently, it takes some error-prone and manual code to send a file when clicking on a link.  This could be bundled up into a listener, something like:
>   <tr:commandLink text="Download file">
>     <tr:sendFileActionListener
>        mimeType="application/pdf" fileName="#{myBean.fileName}"
>        sendFileListener="#{myBean.sendFile}"/>
>   </tr:commandLink>
> ... where all the user needs to write is:
> public void sendFile(OutputStream os) throws IOException
> {
>   // write bytes
> }
> ... and we'd set the right headers, call FacesContext.responseComplete(), etc.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.