Weinan Li

On Wednesday, January 2, 2013 at 10:50 PM, András Csányi wrote:

> Dear All,
> I would like to get some clarification and a little help.
> I'm going to create a software which has REST service on server side
> and it will have to type of client, a native client built on Swing and
> a client based on gwt.
> Question 1:
> According to the documentation if I use this at server side I can
> reach the service as a form. In case of web based application a form
> is needed and the url (@Path) must be called by post method. In case
> of swing, an object is needed properly annotated and it must be posted
> by the client to server side. Do I understand correctly this part?

RESTEasy has provided a component called 'RESTEasy JS-API', which will generate 
the client side codes in javascript format, and the generated code clearly show 
to you how to build up a request correctly to a @Form and @FormParam backed 
API. You can also refer to the sample codes in 'resteasy-jsapi-testing':


After understanding how to send/recv the data, you could build up the client 
side by yourself.
> @Path("/partner/new)
> public String putNewPartner(@Form PartnerEntityDTOClient newPartnerEntityDTO) 
> {}
> Question 2:
> I will use lot of dto classes - they will have mostly string, date and
> binary stuff - and they will be moved between the client and the
> server. The protocol will be JSON. According to the documentation I
> have to create both object the request and the response object for
> every dto class to handle the JSON protocol. Do I understand
> correctly? If so, than I would like to ask whether is there any
> tutorial or blog or book which helps to write these classes?
> Unfortunately, the documentation detailed deeply enough for my
> knowledge.

You can build client side codes al by yourselves, or you can use RESTEasy 
client api:


I haven't tested whether it supports JSON marshal/unmarshal yet. Maybe other 
people in this list could give you more answers on this. I'll verify it later 
and tell you my findings ;-)

Sorry if I misunderstand your question. Please tell me if I've made anything 
wrong :-)
> Thanks in advance!
> András
> --
> -- Csanyi Andras (Sayusi Ando) -- http://sayusi.hu --
> http://facebook.com/andras.csanyi
> -- ""Trust in God and keep your gunpowder dry!" - Cromwell
> ------------------------------------------------------------------------------
> Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery
> and much more. Keep your Java skills current with LearnJavaNow -
> 200+ hours of step-by-step video tutorials by Java experts.
> SALE $49.99 this month only -- learn more at:
> http://p.sf.net/sfu/learnmore_122612  
> _______________________________________________
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net 
> (mailto:Resteasy-users@lists.sourceforge.net)
> https://lists.sourceforge.net/lists/listinfo/resteasy-users

Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
Resteasy-users mailing list

Reply via email to