« Return to Thread: Returning a file attachment and a page together in a request

Re: Returning a file attachment and a page together in a request

by Thiago H. de Paula Figueiredo :: Rate this Message:

Reply to Author | View in Thread

Em Sat, 27 Jun 2009 23:00:42 -0300, Raghu Yegavakota  
<raghu.tapestry@...> escreveu:

> I am a newbie to Tapestry and have a question:

Welcome! :)

> I am able to do (1) using StreamResponse but not sure how to solve (2)-  
> send a Page response back and a file as an attachment.

To redirect the user to a page (Login, for example), just return a page  
instance (got through @InjectPage) or the page class instance  
(Login.class) in the onActivate() method instead of the StreamResponse.

As far as I know, you can't return a page and an attachment in the same  
request. Using Javascript (window.location = "...";) in the returned page,  
you can instruct the user's browser to make another request (in this case,  
a file as an attachment).

--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...

 « Return to Thread: Returning a file attachment and a page together in a request