Restly

A simple REST framework for Java
Download

Restly Ranking & Summary

Advertisement

  • Rating:
  • License:
  • BSD
  • Price:
  • FREE
  • Publisher Name:
  • Erik Beeson
  • Publisher web site:
  • http://code.google.com/p/restly/
  • Operating Systems:
  • Mac OS X
  • File Size:
  • 2 MB

Restly Tags


Restly Description

A simple REST framework for Java Simply put, Restly is an easy-to-use framework for building RESTful webservices in Java. So far, Restly includes 2 representations: · StringRepresentation: returns the given String as the entity body and sets the content type to text/plain · SerializedRepresentation: takes an object and serializes it with XStream as text/xml or application/json, depending on the provided Accept request header. Here are some key features of "Restly": · Resources are represented by Classes identified with a @Resource("...") annotation and automatically discovered from the WEB-INF/classes directory. · Parameter to @Resource is the path that the resource is bound to, supporting templating with {...}. · HTTP methods map to methods on the resource class and MAY return an instance of a Representation, which will get returned to the client. · Automatically converts HEAD requests to a GET request and suppresses the output of the entity body. · Automatically enumerates available methods and responds to OPTIONS requests. · Request parameters, request attributes, Resource path attributes, and HttpServletRequest/HttpServletResponse objects automatically injected by name into fields on the Resource class. For security, request parameters will only be injected into public fields. · Resource level and method level interceptors by means of decoration with @InterceptedBy(...) annotation. Interceptor interface defines methods called before and after execution of the resource method. Before interceptor returns: · InterceptorChain.next Continue processing the next Interceptor or resource method. · Representation Halt all further execution of interceptors or resource method and return this Representation to client. · null Halt all further execution of interceptors and moves on to execute resource method. · After interception takes the Representation return from the resource method, and returns a Representation (either the same as the one passed in, or a different one). · Fields can be decorated with OVal annotations which will be checked before invoking the method, and errors will be reported to the client automatically with descriptions serialized in requested format in entity body and appropriate status code set. · Tunnels PUT and DELETE through POST using either an HTTP header (X-HTTP-Method-Override) or a parameter (method-override). · Negotiates content type via Accept header. Automatically checks for XML or JSON. Might make this configurable at some point. · Correctly sets response codes based on various kinds of detectable errors (Method Not Allowed, Unsupported Media Type, Bad Request). · By default, when SerializedRepresentation outputs XML, it includes a stylesheet based on resource class name, method name, and a configurable base URL. May be excluded by passing null as second parameter to constructor. Requirements: · Java


Restly Related Software