In the previous article (Part 1), I discussed an example application that uses a frevvo form to compose entity resources into a view resource that can be used to update the entities.
frevvo forms are very flexible in the way they can interact with Entity resources (documents). We can say that using the form is equivalent to editing one or more documents. For each document that the form edits, you can specify:
- a URI template
- a Read Method – empty, GET or POST
- a Write Method – empty, PUT, POST or DELETE
Consider the example from Part 1. Here are the entities – Customer and Lists of Customers and the methods they support.
| Resource | Method | Description |
|---|---|---|
| Customer List | GET | List of customers (may be criteria based) |
| Customer List | POST | Create new customer |
| Customer | GET | Get customer data |
| Customer | PUT | Update customer |
| Customer | DELETE | Remove customer |
Consider the case where the form is used to update customer information. To create the form:
- Upload your customer schema to the designer and add the customer to the form (which automatically generates controls)
- Drag/drop, change labels etc. directly in the browser
- Specify URI template …/customers/{customer}, choose Read Method GET and Write Method PUT
- Specify a Form Action URI if desired
That’s it. You can access the form using its URI and a query parameter: …/form/1234?customer=ashish. The URI template above will be resolved to: …/customers/ashish. The diagram below shows the interactions.

Instead of updating a customer, let’s say you want to create a new customer. Just change the Read method to POST and use the URI template: …/customers/. frevvo will perform the POST and follow the server redirect to the newly created resource. When the form is submitted, the newly created customer will automatically be updated. The diagram below shows the interactions.

This is applicable independently to each document that the form edits. If the form is editing Customer, Bill and Order documents, you can specify independent URI templates and read/write methods for each document and frevvo will automatically read/write them using the appropriate URI & method.
In this manner, the combination of URI templates, read/write methods and form parameters provides a very powerful and flexible way to interact with the web. You can easily create REST applications that handle complex visual elements without compromising REST principles.
In the next post, I’ll show you how easily frevvo can create and locally store documents (resources) for you. These documents can also be accessed using simple HTTP URIs.

