Learn Java for Web Development

(Tina Meador) #1

256 CHAPTER 5: Building Java Web Applications with Spring Web MVC







  1. ${book.author.authorName}




  2. ${book.bookTitle}












  3. Add books.








   Line 25: The form controller is called using addBook.html, which is mapped on
lines 22 and 24 of the AddBookController in Listing 5-46.

Listing 5-49 illustrates the new JSP page of the bookstore application for form processing that will be
displayed when the AddBookController is invoked using Add books.
on line 25 of Listing 5-48.


Listing 5-49. addBook.jsp



  1. <%@page contentType="text/html" pageEncoding="UTF-8"%>

  2. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

  3. <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>



  4. <!DOCTYPE html>











  5. Your Book store








  6. Add Book






  7. Author













  8. Book Name





















Listing 5-49 illustrates the form displayed. It also shows the usage of Spring form tags.

Free download pdf