They look like this:
@GET
@Produces({MediaType.APPLICATION_JSON,
MediaTypeExt.APPLICATION_RDF_XML})
public Response doGet(@Context Request req,
@QueryParam("a") List<String> a,
@QueryParam("b") List<String> b,
@QueryParam("c") List<String> c,
@QueryParam("d") String d,
@QueryParam("e") String e) throws URISyntaxException,
IOException, Exception {
....
}
MediaTypeExt is just a class that extends MediaType so I can define the new
media type for application/rdf+xml.
Thanks.
On Tue, Jan 26, 2010 at 2:26 PM, Santiago Pericas-Geertsen <
Santiago.Pericasgeertsen_at_sun.com> wrote:
> Dario,
>
> Could you provide more information about how your resource classes look
> like?
>
> -- Santiago
>
> On Jan 26, 2010, at 8:20 AM, Dário Abdulrehman wrote:
>
> > I added the following media type mappings but I get a resource not
> available error if I invoke my WS with, for example, GET /resource.json
> >
> > I am using Glassvish v3 and Jersey 1.1.
> >
> > Thanks.
> >
> > public class MyServletContainer extends ServletContainer {
> > @Override
> >
> > public void initiate(ResourceConfig rc, WebApplication wa ) {
> >
> > super.initiate(rc, wa);
> >
> > rc.getMediaTypeMappings().put("json",
> MediaType.APPLICATION_JSON_TYPE);
> > rc.getMediaTypeMappings().put("rdf",
> MediaTypeExt.APPLICATION_RDF_XML_TYPE);
> >
> > }
> > }
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>