On 06/09/10 13:26, webp...@tigris.org wrote: > Hi everyone, > > I have a web app who is divided into a "web services" and a "ui" front end. > Actually the "ui" is made from servlets who call a business services layers > and my "web services" use the same business layer. > But I wonder if it is a way to write a set of REST services for replacing the > old web services and using these REST for the ui too. > Does someone have some usefull tips or experience about that ? > > I have used Restlet in such fashion using the internal web connector and using freeMarker (or velocity) as a way to server dynamic content from the various ressources, but I found it is perhaps not the proper way to do it as you find yourself making some Rest requests uri that carry UI presentation options (example choosing one template or an other for a given ressource).
So you tend to have a REST implementation of your app's ressources and a UI (server side) representation to provide to the client. In this case Resltlet don't offer you clear advantage over other server side provider (your java actuel java container, a simple ruby/python http stack like sinatra or the like). If you look at the View side (on the classical MVC) you could consider moving more ressources to the actual client using Restlet as the controled/model and making the view (controled view) be generated directly on the browser client (e.g using jQery). Then your "web services" side could provide a simple json RESTlet application access layer and you'll make standalone javascript page (or server side generated javascript applications) and use ajax (websockets) to talk to your Restlet App. ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2656782