On Mon, 31 Jan 2005 21:04:34 -0600, Vic <[EMAIL PROTECTED]> wrote: > Craig McClanahan wrote: > > > I have proposed that Shale indeed be adopted in that way, and > >will continue to encourage it; > >:-) > > > (It took me a year after Struts .06 was out to find it, it took me a > year to use CoR after that was there .... ) > > Remember the WS for Struts at sf.net a week back? > If I wanted to wire a WS (ex: Hessian, JMS, REST, > http://java.sun.com/blueprints/corej2eepatterns/Patterns/TransferObject.html > (also used by Flash/Flex ;-) or ad noseum) ... would Struts+CoR or Shale > be better on technical points? > (right now I use CoR string dispatcher taking http requests) >
Shale, as of last Saturday, implements a pattern for doing REST-ful requests from clients ... such as JavaScript methods running XmlHttpRequest requests, or Flash remoting, or ... that maps incoming URLs to a corresponding CoR chain or command. Even though there aren't any client side examples of this yet, you can see it in action by downloading the Use Cases example app, deploying it on your favorite container, and then executing a query like: http://localhost:8080/struts-shale-usecases/list/supportedCategories.remote or http://localhost:8080/struts-shale-usecases/list/supportedLocales.remote and you'll get back an XML response. The requests that match a specified URL pattern (in the example app it's *.remote) are passed to a special handler that constructs a specialized CoR Context object (org.apache.shale.remote.RemoteContext) that makes it easy to do REST-type queries (including using request parameters to configure queries), to create XML responses (if you want to do it programmatically, check out the ResponseWrapper API), and to create unit tests for your remote commands (because RemoteWrapper isolates you completely from the servlet API, so it is very easy to mock). You can do the same thing functionally with Struts 1.x and an Action that maps a request to a chain, but it's easier to develop and test the server side functionality with Shale. > .V Craig --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]