Thursday, March 5, 2009

Spring is in the air

The following listing shows a web controller, exclusively based on annotations.
@Controller
public class MyController {
@RequestMapping("/removeBook")
public String removeBook( @RequestParam("book") String bookId ) {
// do something meaningful
return "redirect:myBooks";
}

@RequestMapping(value = "/reward/{id}", method = GET)
public Reward show( @PathVariable("id") long id ) {
return rewardsAdminService.findReward(id);
}
}


REST Everywhere from Spring 3 is in the air - a first look

0 comments:

Post a Comment