Monday, September 28, 2009

Restful with Spring

Unique Idetifier - URL - Noun
  • Path - Hierarchy based - Business Object
  • Abuse
  •     URL - Query Sting
  •     Delete HTTP
  • Do and Dont
  • Hierarchies - Query abuse
URI Tempalets:
@Controller
@RequestMapping("/hotels/{hotel}")
public class HotelsController {
    @RequestMapping
    public void handleHotel(@PathVariable{"hotel"} String hotel) {
    ...
    }
    @RequestMapping("bookings/{booking}")
    public void handleBooking(@PathVariable("hotel") String hotel, @PathVariable int booking){
...........}
}}
Representation:
  • Using View to give out depending upon file ext or accept header.
Method Conversion
  • Get - Retrive represenation of resource - Hotel booking
  • Put - Update rerouces - Create Hotel
  • Post - Create new resource - Booking
  • Delete - Delete resource - Delete Hotel
  • HTML does not supprot Get and post.
  • JS - Post wiht hiddenHttpMethodFilter
Get is Cacheable
  • Returns ETag - Get return it when to ensure that cliet side cache
  • Rest Tempalate:
  • RESTful Web Applicatio for Spring 3.0
JAX-RS
  • More targeted toward machine to machine iterations
Spring RESTFul -
  • MVC more human interation and consumption
  • They will move toward Machine to machine in later sections.
  • Claim that JAX-RS already support spring types.

0 comments:

Post a Comment