Java Reference
In-Depth Information
Figure 5-20. Directory structure of the bookstore application
Let's replace the interface-based controller in Listing 5-42 with an annotations-based controller.
Listing 5-44 illustrates the annotations-based BookController .
Listing 5-44. Annotations-Based BookController
1. package com.apress.bookstore.controller;
2. import com.apress.bookstore.service.BookService;
3. import org.springframework.stereotype.Controller;
4. import org.springframework.web.bind.annotation.RequestMapping;
5. import org.springframework.web.bind.annotation.RequestMethod;
6. import org.springframework.web.servlet.ModelAndView;
7.
8. @Controller
9. @RequestMapping("/list_book.html")
 
Search WWH ::




Custom Search