On 7/1/07, Stjepan Brbot wrote: > Hi, > > I have one classic HttpServlet for dynamically rendering an image from given > (database retrieved) data. Actually this servlet takes data from session > (previously retrieved from database and put inside session) and renders the > image. Since this is not Action but classis servlet it is mapped in web.xml > as '/ImageServlet'. When I have in my html/jsp tag like this one ' src="/ImageServlet">', I get wanted image. That's all fine. > > Now, I'd like to avoid using session for this purpose and like to take data > for ImageServlet from request but I see that request data is not forwarded > in additional browser's request for image. When I originally request page > like 'page.jsp?id=1' this 'id=1' is not forwarded in request for image data > '' from page.jsp! That's why I use session. Is this > only possibility? Can I use '' or '' > and expect original page request to be forwarded to image request as well? > > On the other hand, how to create Struts' Action that could be used for the > same purpose of rendering image? In classic HttpServlet there are methods > doPost/doGet which do not return any data (void) but Struts' Action expects > ActionForward as a return value. What might be the return value in case that > this Action is used for rendering image and called inside ' src="/ImageAction">' or ''? There is just such a DownLoad action designed to help with this - you just need to return "null" from the Action's execute method, rather than an ActionForward: http://wiki.apache.org/struts/StrutsFileDownload http://struts.apache.org/1.3.8/apidocs/org/apache/struts/actions/DownloadAction.html Niall > SB --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org