tags:

views:

174

answers:

2

Hello,

I'm working on on a site built using struts2. The vast majority of our targets generate xml, so mapping the result to a jsp page makes sense. A couple of our targets actually generated binaries. I'm wondering if there is a convenient way to say that the result should come from a servlet/controller instead of a jsp.

Obviously this could be done by modifying the web.xml so the struts filter doesn't apply to those targets and mapping those targets as servlets, but this is non-ideal. Currently, the struts filter applies to the entire site, and we would like to keep it that way.

Ideas?

Thanks!

A: 

I am not sure I understand you scenario, but it seems to me you want the Stream Result

leonbloy
yep, that's exactly what I was looking for. Thanks!
Jim
A: 

Hello there

Here you can find an excellent tutorial with code examples about Struts2 file upload and file download that covers the Stream Result:

http://www.jeetrainers.com/struts2-course/chapter12-13-1-1#slide

Mark