• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Binary content from struts action

 
Ranch Hand
Posts: 2596
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have an action that generates response either as text or binary depending on the parameters passed to it. When it is a text response, it can easily be shown in the associated velocity templete (using VTL instead of JSP here) appropriately. However, I am wondering when the response is binary how would I send it to the client given that I am forwarding it to the velocity page.

I am thinking on these lines... let me know if this approach sounds fine --
When the response is text, it is forwarded to the regular VTL template, however when the response is binary, it will store that response in a request attribute and will forward to a servlet which will simply output that binary response. Is that fine?

TIA,
- Manish
[ November 17, 2005: Message edited by: Manish Hatwalne ]
 
Manish Hatwalne
Ranch Hand
Posts: 2596
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just for record -- I have tried and found that approach I have described works quite well. Just wondering if another better aproach to this?

- Manish
 
And then the entire population worshiped me like unto a god. Well, me and this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic