You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Luka Surija <lu...@iytim.hr> on 2007/06/13 02:09:42 UTC

Re: [jira] Created: (TRINIDAD-52) Add actionListener to make sendingfiles easy

Adam Winer (JIRA) wrote:
> 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
>
>
> 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.
>
>   
Wow, that's great feature.

-- 
Luka Ĺ urija
luka.surija@iytim.hr
+385 98 434 061

I.Y. tim d.o.o.
www.iytim.hr
info@iytim.hr