users@jersey.java.net

[Jersey] Re: Image As a Jersey Response

From: Joseph Mocker <jmocker_at_velti.com>
Date: Wed, 30 Jan 2013 17:45:09 +0000

The @Produces annotation can accept multiple MIME types as an array, for example @Produces({"images/gif", "images/png"})

 See http://docs.oracle.com/cd/E19226-01/820-7627/gipxf/index.html for more information. Would this work for you?

  --joe

Joseph Mocker | Velti | Senior Software Architect
t +1.650.566.7033 m +1.408.676.6625
e jmocker_at_velti.com @Mobclix

The leading global technology provider of
mobile marketing and advertising solutions

On Jan 30, 2013, at 5:53 AM, selvakumar netaji wrote:

> Hi All,
>
> I've designed a rest service to upload a image of various formats. The service loads the image into the database..
>
> This works fine but the get service which retrieves the image creates the problem for me. I have annotated the get service as @Produces("image/png"), which works fine for png images stored in the database, If i annotate as @Produces("image/*") its not working for any of the images. Can you guide me to handle the situation to support all the images.