Learn Java for Web Development

(Tina Meador) #1

196 CHAPTER 4: Building a Web Application Using Struts 2


As you can see in the directory structure there is a single BookController in the application.
The methods in this controller are illustrated in the Listing 4-39.


Listing 4-39. BookController



  1. public class BookController extends ActionSupport {



  2. //properties



  3. public String login() {}



  4. public String executelogin() {}



  5. public String error() {}



  6. public String allBooks() {}



  7. public String booksByCategory() {}




Figure 4-23. Directory structure with the data access layer

Free download pdf