Providing APIs for the Tapestry Web Application

I am working on a Tapestry 5 based web application that should expose the API for iPhone and Android devices. The API is currently implemented using the built-in MVC features for tapestries. For example, all services are handler methods that return JSON strings in Tapestry page classes for mobile access. Authentication is done using Spring Security, and each user is tied to a session. I'm new to this, so correct me if I'm wrong, but that doesn't seem like a very clean solution.

What are the possible disadvantages of these solutions? What are the significant benefits when using the REST-API? What would be best in this case?

+4
source share
3 answers

For SeeSaw.com, we have similar requirements to expose channels from our T5 web application and have tried different approaches.

For read-only data, we present a T5 page / component record that displays XML (or JSON) as a feed. To read / write data, we implement OnXXX tapestry events via JSON. By breaking it in this way, you get a more efficient site (since only reading can be cached).

+1
source

Perhaps this will help ...

Skin templates

To quote an article

In this article I want to share with you a wonderful new Tapestry feature introduced in 5.3. This feature allows you to provide different skins for a single page, creating multiple templates. These different patterns are used by the Tapestry to render the same page in a special way for different clients. For example, when developing a web application for standard and mobile clients, you may need to display the same page depending on the current client. Thus, you need to create two different templates for each page and select one of them depending on the user agent sent by the client.

Could this be the “clean solution” you are looking for? Hooray!

Murray ...

0
source

All Articles