Marcus Brito <pazu <at> pazu.com.br> writes:

> ... This way, a URL like "http://example.com/category/10";
> directly maps to that element, using 10 as the id parameter. I can't 
> overstate how nice this is, specially when developing RESTful API's.

You can do this with a service encoder in Tapestry.

> One other thing I miss in Tapestry are templateless pages -- a page where all
> output is rendered programatically, and no template is needed. I know, I could
> write a whole new service, but isn't that a little too much? Specially if you
> have only a couple of these pages in an otherwise big application.

Try using a template like:

<span jwcid="@Insert" raw="true" value="ognl:pageContent"/>

Then write a page class like:

public class Home extends BasePage {

        @Override
        public ContentType getResponseContentType() {
                return new ContentType("text/xml");
        }
        public String getPageContent() {
                return "<foo>123</foo>";
        }

}

Of course, if you're writing a web service, you may want to integrate
say a web service engine (eg, Apache Axis) into your app. This will
provide you with nice features like data-binding.

--
Author of a book for learning Tapestry (http://www.agileskills2.org/EWDT)


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to