- Path - Hierarchy based - Business Object
- Abuse
- URL - Query Sting
- Delete HTTP
- Do and Dont
- Hierarchies - Query abuse
@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.
- 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
- Returns ETag - Get return it when to ensure that cliet side cache
- Rest Tempalate:
- RESTful Web Applicatio for Spring 3.0
- More targeted toward machine to machine iterations
- 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