May 9th, 2007, 03:07 AM
Stream byte from a web-flow action or MVC controller
I have a service that returns a byte of a generated photo and I would like to stream this to the client. E.g. I want the client to invoke an action/controller using the img markup tag (<img src="http://myhost/getPhoto?guid=xxxx" />) and this should stream the byte to the client. How should I achieve this in Web-Flow? Should I use a pure Spring MVC controller for this? In that case, how do I hook this controller into the DispatcherServlet used by web-flow? (I'm using the schema based approach to declare the web-flow stuff in xml). I also need something similar that works in a Portlet environment.
May 21st, 2007, 03:50 AM
Is that image data stored inside the flow execution (e.g. in flow scope)?
If so, the best approach is probably to code a seperate controller (Normal Spring MVC controller) to stream it to the client. The controller can get access to the flow execution like described in this tip: