views:

37

answers:

1

Hi all! I'm using a fancybox to work with images in my Java Web Application. Here is some code of my.jsp:

<c:forEach var="imageName" items="${requestScope.myCollection.imageNames}"> <a rel="image_group" href="/My_War/large/${imageName}.do" title="${imageName}"><img alt="" src="/My_War/small/${imageName}.do" /></a> </c:forEach>

And here is one of functions of my spring image controller, that writes images as byte stream:

@ExceptionHandler(IOException.class) @RequestMapping(value = "/large/{name}.do", method = RequestMethod.GET) protected void getLargeImage(@PathVariable("name") String name, OutputStream outStream) throws IOException{ //here I read an image as byte stream and write it into output stream outStream.write(Utils.readImageFromFolder(name, false)); outStream.flush(); outStream.close(); }

So I have a difficult with maximazing an image. Small images load correct, but when I click on them it show me garbage. I understand, that it should be a link to real image at my jsp, not to image controller. So how can I solve this problem? Help please:)

A: 

I found the solution; it's so simple:) Just add property: 'type' : 'image' to fancybox config)))

Vov4a