forge/core — pull request #207 by xandrox (2012-09-04 15:34:28+00:00)
Title: Improvements for a more restful rest plugin

Hi,

I did some improvements on the rest plugin that I like. But some things are not really restful and I have to change them in the generated code all the time.

1. Restful means stateless. Its not an optional thing. Resources have to be stateless. So the EJBs have to be also Stateless (no extended persistence context). A stateful EJB, that is not bound to a http session makes no sense in my eyes. Its creates new instances all the time...

2. REST is not SOAP. SOAP has Endpoints, REST has Resources. So the resources could not named endpoints. I changed everything form endpoint to resource...

3. I changed the generated code to some typical REST conventions
3.1. POST creates a Resource and returns the proper status code (created) and URI to the created resource
3.2. DELETE and PUT should return "no content"
3.3. Resource should return a 404 if they did not exist

I hope my changes are ok.

Best regards
Sandro