Jeff,
I have the following line in my template :
<img src="$link.setAction("ViewAction").addPathInfo("filename",
$doc.Filename).addPathInfo("regid", $doc.Registryid)"/>
and following is an extract from my ViewAction doPerform() method.
You need to look at the turbine wiki pages on VelocityOnlyLayout for
details of the DirectResponseLayout class.
I hope this helps. Sorry to be terse but its nearly 1.00am local time
and i've had enough for today.
> data.setLayout("DirectResponseLayout");
> data.setScreen(null);
> data.setScreenTemplate(null);
> // Set up response
> HttpServletResponse response = data.getResponse();
> data.declareDirectResponse();
> ServletOutputStream sos = response.getOutputStream();
> String contentType = null;
> File img = new File(vfn);
> if (!img.exists())
> {
> log.warn( "--" + sid + "--" + "ViewAction-doPerform()-Image file
> not found : " + img.getPath());
> return;
> }
> log.debug( "--" + sid + "--" + "ViewAction-doPerform()-Image file found :
> " + img.getPath());
> if (img.getPath().toUpperCase().endsWith(".BMP"))
> {
> contentType = "image/png";
> response.setContentType(contentType);
> FileInputStream fis = new FileInputStream(img);
> CryptoServiceImpl cis = new CryptoServiceImpl();
> cis.initialize(false);
> InputStream dis = cis.decryptIS(fis);
> BMPHandler bmph = new BMPHandler();
> bmph.bmpToPNGStream(dis, sos);
> fis.close();
>
> }
>
> On Wed, 2003-07-16 at 00:39, Jeff Owens wrote:
> Hey Howdy,
>
> Right now I'm using Apache on my front end server connected to Tomcat on my backend
> server. All my dynamic web stuff is served through Apache using Tomcat, which I'm
> running a Turbine based application on.
>
> I've got a couple situations where I'm using Turbine/Velocity to send a PDF directly
> to a raw screen template. The user clicks something like, "Hey, let me see this PDF
> report", and an action sets the template, and content type and so on, then sends the
> PDF back. Works great! Presto! The user gets a fancy looking Acrobat report in
> their browser window (providing they have the reader installed).
>
> Now I have a situation where I'm going to convert the PDF to a PBM (Portable Bitmap)
> but I want to return the bitmap inside a Velocity template with other html. I DON'T
> want to transfer the PBM file directly to a raw template, and I DON'T want to
> transfer the PBM from the backend server to the frontend server to be delivered by
> Apache.
>
> Is there a way to do this - embed picture data inside an html doc?
>
> Thanks very much,
> Jeff Owens
--
Peter Courcoux <[EMAIL PROTECTED]>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]