You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Sergey Beryozkin <se...@iona.com> on 2008/04/21 17:35:30 UTC

Re: REST->JS

Hi Jervis

I'm sorry for replying so late...
The idea behind ?_js or ?_lang=js is not to indicate to the runtime that the invocation is coming from a JS client stack but to
provide on the fly generation of the client execution code (JS in this case), similar to what Benson did for JAX-WS services. Such execution fragment can then be embedded into XHTML pages, etc. 
Perhaps a better option would be to support .js extensions, something like
GET /customer.js

Either way, CXF JAX-RS impl supports handlers which can be invoked before the invocation is made on the actual resource class. These handlers need some minor cleanup, but as far as the generation of such JS client code is concerned, it would be a matter implementing a handler capable of looking at a ClassResourceInfo (the model class you created originally) and returning a JAX-RS Response with its entity being the generated (JS) code...

Cheers, Sergey


----- Original Message ----- 
From: "Jervis Liu" <je...@gmail.com>
To: <cx...@incubator.apache.org>
Sent: Monday, March 24, 2008 3:14 AM
Subject: Re: REST->JS


> Hi Sergey, could you elaborate a bit more on the ?_js or ?_lang=js stuff
> please. I thought what Benson and Arul were talking about is a pure client
> stack that is implemented in Java script that can connect to JAX-RS
> compatible RESTful services. As far as the JAX-RS  server side is concerned,
> it does not matter the request is coming from a java script client or
> anything else, does it?
> 
> 

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland