Have a look at the way that the Jasper Reports code works (JasperReportViewServlet). It treats the output format as a view and takes its data from the action. Putting binary data on your action seems wrong to me.
On Tue, 2003-01-14 at 03:12, Vedovato Paolo wrote: > I came across this thread (see at the bottom) in my ww mail archive, which > exactly matches a requirement I have to implement. > > Is the answer from Rickard still the prefered way to achieve a saving of > a content (e.g. word document)? > > since I didn't find the BinaryResult action explained by Rickard is there > another action/way already implemented in webwork to achieve this behaviour? > > As always: thanks for the help ;-) > > Cheers > -Paolo > > >Subject: Re: [Webwork-user] action that returns document other than > >.html > > > > > >Taavi Tiirik wrote: > > > >> What would be the best way to implement an action that returns > >> something else than plain .html? I need to return ms word > >> document that could be then opened or saved to disk. > >> > >> Anybody cares to point me in the right direction? > > > >You could write an action that performs this for you. The action would > >do this: > >* allow a content type to be set > >* output bytes taken from a particular property > > > >This action would then be used as the result view for your word > >retrieval action. I.e. in your views.properties you'd have this: > >wordfile.action=WordFile > >wordfile.result=BinaryResult.action?contentType=<word file > >type>&data=fileData > > > >In WordFile.java you'd then put a method getFileData() that returns > >byte[] which the BinaryResult action will get and output. > > > >IMHO it might be a good idea to put this BinaryResult action in the > >standard action repository in WebWork, since it seems like a > >common need. > > > >/Rickard > > > >-- > >Rickard �berg > >Software Development Specialist > >xlurc - Xpedio Link�ping Ubiquitous Research Center > >Author of "Mastering RMI" > >Email: [EMAIL PROTECTED] > > > > > >_______________________________________________ > >Webwork-user mailing list > >[EMAIL PROTECTED] > >https://lists.sourceforge.net/lists/listinfo/webwork-user > > > > > ------------------------------------------------------- > This SF.NET email is sponsored by: FREE SSL Guide from Thawte > are you planning your Web Server Security? Click here to get a FREE > Thawte SSL guide and find the answers to all your SSL security issues. > http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en > _______________________________________________ > Opensymphony-webwork mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork -- Peter Kelley <[EMAIL PROTECTED]> Moveit Pty Ltd ------------------------------------------------------- This SF.NET email is sponsored by: FREE SSL Guide from Thawte are you planning your Web Server Security? Click here to get a FREE Thawte SSL guide and find the answers to all your SSL security issues. http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork
