Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts Users »

RE: generating a text file

Pady Srinivasan

2004-03-24



This is what we did in our Action:

// generate the file
File file = generate();
// download
response.setContentType("text/plain");
response.addHeader("Content-Disposition", "attachment;filename=" +
file.getName());
return new ActionForward("/logs/" + file.getName());


Thanks

-- pady
PSrinivasan@(protected)


-----Original Message-----
From: otavio.augusto@(protected)]
Sent: Wednesday, March 24, 2004 9:16 AM
To: struts-user
Subject: generating a text file

Hi all. I have to generate a text file (filled with a
pre-formated text) after a certain action is finished.
this file is a kind of confirmation of a certain
business action. so, as my application is web-based, I
think I should let the user download this text file
when it is generated. how to automatically start the
download? I mean ,fire up the download confirmation
menu, so the user confirms he wants to receive the text
file or not.

thanks in advance


Otávio Augusto

__________________________________________________________________________
Acabe com aquelas janelinhas que pulam na sua tela.
AntiPop-up UOL - É grátis!
http://antipopup.uol.com.br/



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@(protected)
For additional commands, e-mail: struts-user-help@(protected)


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________

______________________________________________________________________
This email has been scanned by the Heroix e-mail Security System
______________________________________________________________________

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@(protected)
For additional commands, e-mail: struts-user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.