users@jersey.java.net

return different Mime type from the same method

From: guilhem legal <guilhem.legal_at_geomatys.fr>
Date: Thu, 06 Dec 2007 11:42:04 +0100

hi!
I am a beginner with jersey and i have a little issue :

i would like to return different Mime type from the same method
(image/png or text/xml).
if i put this @ProduceMime("image/png") on my method this work when i
return a File, but i can't return xml.
if i put @ProduceMime("text/xml") i can't return image.
and if i put @ProduceMime("*/*) and i return a file this works for both
but the browser does not open the file and ask me to download it.

can we change dynamically the ProduceMime Type?
or can we adjust the return type with @ProduceMime("*/*) to display an
image? (for xml i can return string but for image?)

if you have a solution to my probleme please reply me.

thanks
Guilhem Legal