Alterar no nome do arquivo de download com struts 2  XML
Índice dos Fóruns » Desenvolvimento Web
Autor Mensagem
Flavio machine
JavaEvangelist
[Avatar]

Membro desde: 02/04/2008 13:24:56
Mensagens: 485
Offline

To tentanto mudar dinamicamente o nome do arquivo que vai fazer o download.

ja tentei fazer isso aqui na action mais não deu certo não

HttpServletResponse response = (HttpServletResponse) ActionContext.getContext().get(ServletActionContext.HTTP_RESPONSE);
response.setHeader("Content-Disposition", "attachment; filename=\"" + "ddd.doc" + "\"" );

Usei esse tutorial aqui

http://www.mkyong.com/struts2/struts-2-download-file-example/

[Email] [MSN]
 
Índice dos Fóruns » Desenvolvimento Web
Ir para:   
Powered by JForum 2.1.8 © JForum Team