You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by James Neville <ja...@babcockbrown.com> on 2003/11/27 12:21:06 UTC

[OT]Re: ui generation

ajay brar wrote:

> so how do you convert the jsp (resulting from the choices he made) to 
> html? Say when i make a request for a jsp page, the server processes 
> the request and what gets outputted to my browser is html. How can i 
> force that to happen and pipe the output to a file? 

Ajay: in my half asleep mode......

1. Write the file to the server filesystem, probably a temp directory, 
and call it by a unique name (time in millisconds and the session id 
maybe?).
2. Set the content type of the servlet response to something like 
'application/octet-stream' (this will make sure the browser doesn't try 
to render it).
3. Stream the file to the response.
4. The client will be presented with the typical "save as" browser 
dialog box.


Check the Struts and Tomcat archives, you'll find more detail and 
probably some sample code in there.
Cheers,

James


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org