• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

Binary content from struts action

 
Ranch Hand
Posts: 2596
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
God is a comedian playing for an audience that is afraid to laugh - Voltair. tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!