my dog learned polymorphism
The moose likes Struts and the fly likes Old Struts and content-type/attachments Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Old Struts and content-type/attachments" Watch "Old Struts and content-type/attachments" New topic

Old Struts and content-type/attachments

Brett Sanger

Joined: Jul 26, 2006
Posts: 7
I've got a case where I need to have a website offer a "download results" link (i.e. return non-html dynamically created data). Normally I'd just used a DownloadAction, but the company is using Struts 1.1 (I know) and that feature doesn't exist.

My google-fu has failed me. How did people do this prior to Struts 1.2?

Thanks in advance
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Just do it the same way you would do it from a Servlet: Set the headers, Get the output stream from the HTTPServletResponse object and write your data to it. Then just return a null ActionForward from your execute method.

Consultant, Sima Solutions
I agree. Here's the link:
subject: Old Struts and content-type/attachments
It's not a secret anymore!