wood burning stoves 2.0*
The moose likes Struts and the fly likes How to stream the bytes of the file from the action? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to stream the bytes of the file from the action?" Watch "How to stream the bytes of the file from the action?" New topic
Author

How to stream the bytes of the file from the action?

kavin clain
Ranch Hand

Joined: Jan 19, 2010
Posts: 68
How to stream the bytes of the file from the action?
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

For S1:

Open a response output stream.
Write the file bytes to it.
Close the stream & flush.
Return null from action.


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Lorand Komaromi
Ranch Hand

Joined: Oct 08, 2009
Posts: 276
For Struts 2, use Stream result!


OCJP 6 (93%)
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to stream the bytes of the file from the action?