users@jax-rs-spec.java.net

[jax-rs-spec users] Testing and configuring Jax Rs 2

From: Jaime Carmona Loeches <jcarmonaloeches_at_gmail.com>
Date: Sun, 3 Mar 2013 09:34:05 +0100

>
> Hi,
>
> I'm Jaime, from JavaHispano, from Madrid Java USer Group.
>
> I've configured GlassFish.4.0.b.70, NetBeans 7.3. I've experienced some
> problems:
> 1) I've to change GlassFish ports (from 8080 to 8181, and from 4848 to
> 4949).
> 2) I've gived write permission in GlassFish domain directory to the same
> user I'm using in Netbeans
>
> After that, I've configured Arun Gupta example:
>
> https://blogs.oracle.com/arungupta/entry/jax_rs_client_api_and
>
> And that's nice.
>
> It's nice to see the Client:
>
> Client client = ClientFactory.newClient();
> WebTarget target = client.target("http://. . ./webresources/fruit" <http://.../webresources/fruit>);
> String response = target.request().get(String.class);
>
>
>
>
>
>
> Integrated easily with the providers.
>
> And later, play making calls.
>
> Client client = ClientFactory.newClient();
> WebTarget target = client.target("http://"
> + request.getServerName()
>
>
>
> + ":"
> + request.getServerPort()
> + request.getContextPath()
> + "/webresources/fruit");
>
> // POST
> target.request().post(Entity.text("apple"));
>
> // PUT
> target.request().put(Entity.text("banana"));
>
>
>
>
> // GET (all)
> String r = target.request().get(String.class);
>
> // GET (one)
> r = target.path("apple").request().get(String.class);
>
> // DELETE
> target.path("banana").request().delete();
>
>
>
>
> // GET (all)
> r = target.request().get(String.class);
>
>
>
> Also, I like the idea of Jax Rs: dsitributed rich web system with a lot of
> kind of http messages and a lot of kind of formats, for that reason, I
> think it's nice.
>
> Regards,
>
> Jaime
>
>
> -- http://twitter.com/arunguptahttp://blogs.oracle.com/arungupta
>
>

-- 
Un saludo,
   Jaime.