Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Binary content from struts action  RSS feed

 
Manish Hatwalne
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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!