« Return to Thread: Finding an example with RESTful that returns an image

Finding an example with RESTful that returns an image

by pakkk1 :: Rate this Message:

Reply to Author | View in Thread

Hi, I have a method must return an image. I haven't found nothing about these.



My method is the next:



@Path("/image")

public class ImageResource {



    public ImageResource() {}



    @GET

    @Produces({"image/jpeg,image/gif"})

    public ?? getImage() {

       byte[] imageReturn = null ;

       try {

            imageReturn = // here an image with the byte[ ] type

       } catch (Exception ex) {

            Logger.getLogger(ProfesoresResource.class.getName()).log(Level.SEVERE, null, ex);

       }

       return ?? ;

    }



What is the type of "??"



Thank you so much!




 « Return to Thread: Finding an example with RESTful that returns an image