db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pavel Kusch" <pa...@icecentric.com>
Subject Re: images / Turbine
Date Thu, 15 May 2003 20:02:26 GMT
Peter,

Thanks a lot! Works perfect!!!

With regards,

Pavel Kusch
iceCentric
309.685.7900
309.264.2674
----- Original Message -----
From: "Peter Courcoux" <peter@courcoux.biz>
To: "Turbine Torque Users List" <torque-user@db.apache.org>
Sent: Thursday, May 15, 2003 1:54 PM
Subject: Re: images / Turbine


> Pavel,
>
> You can do something like this in your template :
>
> <img width="650"
> src="$link.setAction("MyAction").addPathInfo("primarykey",
> $primarykey)"/>
>
> Then in the doPerform method of MyAction.java
>
> and something like this :-
>
> data.setLayout("DirectResponseLayout");
> data.setScreen(null);
> data.setScreenTemplate(null);
> // Set up response
> HttpServletResponse response = data.getResponse();
> data.declareDirectResponse();
> ServletOutputStream sos = response.getOutputStream();
> String contentType = "image/png";
> response.setContentType(contentType);
> // use the primarykey to get the image as a stream
> // and write it to the ServletOutputStream
>
> For more detail on writing directly to the servlet output stream see the
> turbine wiki page titled VelocityOnlyLayout
> .
> I hope this helps.
>
> On Thu, 2003-05-15 at 19:30, Pavel Kusch wrote:
> > Hello,
> >
> > We have images uploaded in database and now we need to get those images
from
> > the database and put them in HTML code using <IMG SRC="" > tag.  The
images
> > are stored as BLOB. Can Turbine help with that?
> >
> > Thank you.
> >
> > Pavel Kusch
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> > For additional commands, e-mail: torque-user-help@db.apache.org
> --
> Peter Courcoux <peter@courcoux.biz>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message