Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 17th, 2012  |  syntax: None  |  size: 0.55 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. a question about Spring controller
  2. @Controller  
  3. public class HomeController {
  4.   public static final int DEFAULT_SPITTLES_PER_PAGE = 25;
  5.   private SpitterService spitterService;
  6.   @Inject                    
  7.   public HomeController(SpitterService spitterService) {
  8.     this.spitterService = spitterService;
  9.   }
  10.   @RequestMapping({"/","/home"})        
  11.   public String showHomePage(Map<String, Object> model) {
  12.  
  13.     model.put("spittles",
  14.               spitterService.getRecentSpittles(DEFAULT_SPITTLES_PER_PAGE));              
  15.     return "home";
  16.   }
  17. }