jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean Callan" <seancal...@gmail.com>
Subject Re: Sample code for accessing pictures
Date Tue, 26 Feb 2008 20:44:50 GMT
Hi Danny,

You could create a servlet and bind it to a specific url say, /image/*.
>From there you could pass the UUID of the specific image as a parameter
(/image/{UUID}), within the servlet modify the headers and output the binary
content.

//get the specific file you need
InputStream stream = file.getProperty("jcr:data").getValue().getStream();
ServletOutputStream out = response.getOutputStream();

//modify the image? resize?
response.setContentType("image/jpg");
ImageIO.write((RenderedImage) img, "jpeg", out);

out.flush();
out.close();

Sorry if my technical jargon is lacking, but you get the point, that code is
similar to what we use here.

Sean

On Tue, Feb 26, 2008 at 4:58 AM, Danny Waldmann <wad@isogmbh.de> wrote:

>
>
>
> Hi!
>
> Maybe you could help me.
>
> I managed to connect from a Tapestry Web Application to a Jackrabbit
> Repository (using JNDI) and can read Text out of it. But,
> is there somewhere some sample code for accessing images in the repository
> for example through a JSP?
>
> Thank's in advance.
>
>
>
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message