Return-Path: Delivered-To: apmail-struts-dev-archive@www.apache.org Received: (qmail 62212 invoked from network); 28 May 2008 22:30:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 May 2008 22:30:13 -0000 Received: (qmail 57953 invoked by uid 500); 28 May 2008 22:30:13 -0000 Delivered-To: apmail-struts-dev-archive@struts.apache.org Received: (qmail 57916 invoked by uid 500); 28 May 2008 22:30:13 -0000 Mailing-List: contact dev-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Developers List" Reply-To: "Struts Developers List" Delivered-To: mailing list dev@struts.apache.org Received: (qmail 57905 invoked by uid 99); 28 May 2008 22:30:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 May 2008 15:30:13 -0700 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of teastlack@gmail.com designates 74.125.46.29 as permitted sender) Received: from [74.125.46.29] (HELO yw-out-2324.google.com) (74.125.46.29) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 May 2008 22:29:25 +0000 Received: by yw-out-2324.google.com with SMTP id 9so1701546ywe.17 for ; Wed, 28 May 2008 15:29:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=pqs5ubMNkB9T8baMmuRZPdN/jqZV4mTgnKCt1hPTCqc=; b=KQeymY74VN5rhmXrgeZtBpehd1a+r9D+CmULZtwNL0Luw+JbKPXCOAg24JwvHtTOE60TTwPKcuGTz/VTUBgKxC5XAHg8p6GEYdYgdHpPvKAStvu2p1dYDCnycPD5j6Bmgo3kP58tGqFB+Fv7kWzrIX8I8ZSBjWX5ri6JmXNrQY8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=ReIO/5PBKLwXxJXFKGiCnLN8dP0KFeR339jFJhlm4FSYELlfovUn2B+arFRF/1fLJf1pa2m14EPzBvtHOlVWiEkksI/TTcFb+ubNmq9hrDpEl+KMoQjNqAtgPm+9hY+pL811koJlrmbaHRSpXjdDrkwg8NUuaCedZt2Enetcp1M= Received: by 10.151.112.16 with SMTP id p16mr6434093ybm.37.1212013758915; Wed, 28 May 2008 15:29:18 -0700 (PDT) Received: by 10.151.109.13 with HTTP; Wed, 28 May 2008 15:29:18 -0700 (PDT) Message-ID: Date: Wed, 28 May 2008 15:29:18 -0700 From: "t e" To: "Struts Developers List" Subject: Re: Struts2 REST project In-Reply-To: <17461247.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_4224_19457187.1212013758919" References: <17461247.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_4224_19457187.1212013758919 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Fair enough, maybe a little history would help: This project started as a Restlet to XWork bridge. After a bit, I realized there were some handy parts of Struts that I wanted to use, so I leveraged some of the Struts knowledge (e.g. FilterDispatcher, etc) to invoke xwork. Restlet is doing a nice amount of work for me managing the conversations. The @URITemplate came from one of the APIs (don't remember which), but no associated tools are used. I simply snagged the name of the annotation in an attempt to be a little more conforming. All of the annotations are handled by the wirings in Spring (there's a page describing configurations, but any object factory should work). Bean descriptors (there are a few different types, 'annotated' being one) are used to configure both the Restlet and the Struts action components and link them together. Yes, the above descriptor configuration will supply the @ResponseClass information to the JaxbContext, making it able to marshall the XML automatically. Variations of the response are handled by decorating the xml marshaller with a JSON or Badgerfish implementation, specified by an "alt" parameter. Re: A list of the useful portions for struts, some points of interest: - caching: A Restlet eventually calls an xwork DefaultActionProxy through restlet handlers. Those handlers have various implementations for caching by associating a URI with the resulting XML entity. - general learning: different approaches give insight, or just seeing how something was implemented might generate ideas. - Using Restlet as a front end: Restlet does a bit of work (multiple params in uri, uri to restlet mapping, etc). This project really just binds a restlet to an action. It probably wouldn't be much to move that configuration (currently in a separate spring config) to the struts.xml. - Testing framework: it was pretty easy to build in a testing framework for the actions that runs in-memory or remotely. There are probably other areas of interest for both probjects (for example, this project doesn't yet use params to determine CRUD behaviors as it should). -Troy On Sun, May 25, 2008 at 12:10 PM, dusty wrote: > > Coolness for sure. I noticed the @URITemplate annotation. That is from > the > WS-REST api? How is that implemented in your example? Is that through > Restlet? > > Is one of the values that it will automagically marshall the XML model > based > on the annotation @ResponseClass? What about a List of things? > > These are the two areas where I think it could help the Struts2 REST > implementation. I think a more "native" Struts2 approach is easier rather > than introducing Restlet in front of Struts. > > > > tdeast wrote: > > > > Hi all, > > I've been working on a project to provide restful services using struts2: > > http://code.google.com/p/fulworx/ > > > > I'm trying to gauge any interest on using any of the code / concepts in > > this > > project for the struts rest plugin. I believe some of the approaches > I've > > taken may dovetail nicely. My goal with this was making restful > > development > > as simple as possible. This project is not a plugin (hence it's not in > > the > > registry), but I'd rather it contribute to the existing plugin if > > possible. > > > > Any thoughts? > > > > Thanks, > > Troy > > > > > > -- > View this message in context: > http://www.nabble.com/Struts2-REST-project-tp17432050p17461247.html > Sent from the Struts - Dev mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org > For additional commands, e-mail: dev-help@struts.apache.org > > ------=_Part_4224_19457187.1212013758919--