You are previewing Servlet, JSP and Spring MVC: A Tutorial.
O'Reilly logo
Servlet, JSP and Spring MVC: A Tutorial

Book Description

This book is a tutorial on Servlet, JSP and Spring MVC. Servlet and JSP are two fundamental technologies for developing Java web applications and Spring MVC is a module within Spring Framework that solves common problems in Servlet/JSP application development. The MVC in Spring MVC stands for Model-View-Controller, a design pattern widely used in Graphical User Interface (GUI) development. Spring MVC is one of the most popular web frameworks today and a most sought-after skill. The book is an ideal resource for anyone wanting to learn how to develop Java-based web applications using Servlet, JSP and Spring MVC.

Table of Contents

  1. Introduction
    1. Servlet/JSP Application Architecture
    2. The Hypertext Transfer Protocol (HTTP)
    3. About This Book
    4. Downloading the Sample Applications
  2. Chapter 1: Servlets
    1. Servlet API Overview
    2. Servlet
    3. Writing A Basic Servlet Application
    4. ServletRequest
    5. ServletResponse
    6. ServletConfig
    7. ServletContext
    8. GenericServlet
    9. HTTP Servlets
    10. Working with HTML Forms
    11. Using the Deployment Descriptor
    12. Summary
  3. Chapter 2: Session Management
    1. URL Rewriting
    2. Hidden Fields
    3. Cookies
    4. HttpSession Objects
    5. Summary
  4. Chapter 3: JavaServer Pages
    1. An Overview of JSP
    2. Comments
    3. Implicit Objects
    4. Scripting Elements
    5. Actions
    6. Summary
  5. Chapter 4: The Expression Language
    1. The Expression Language Syntax
    2. Accessing JavaBeans
    3. EL Implicit Objects
    4. Using Other EL Operators
    5. Using the Expression Language
    6. Configuring the EL in JSP 2.0 and Later Versions
    7. Summary
  6. Chapter 5: JSTL
    1. Downloading JSTL
    2. JSTL Libraries
    3. General-Purpose Actions
    4. Conditional Actions
    5. Iterator Actions
    6. Formatting Actions
    7. Functions
    8. Summary
  7. Chapter 6: Writing Custom Tags
    1. Custom Tag Overview
    2. Simple Tag Handlers
    3. SimpleTag Example
    4. Handling Attributes
    5. Manipulating the Tag Body
    6. Writing EL Functions
    7. Distributing Custom Tags
    8. Summary
  8. Chapter 7: Tag Files
    1. Introduction to Tag Files
    2. Your First Tag File
    3. Tag File Directives
    4. doBody
    5. invoke
    6. Summary
  9. Chapter 8: Listeners
    1. Listener Interfaces and Registration
    2. Servlet Context Listeners
    3. Session Listeners
    4. ServletRequest Listeners
    5. Summary
  10. Chapter 9: Filters
    1. The Filter API
    2. Filter Configuration
    3. Example 1: Logging Filter
    4. Example 2: Image Protector Filter
    5. Example 3: Download Counter Filter
    6. Filter Order
    7. Summary
  11. Chapter 10: Decorating Requests and Responses
    1. The Decorator Pattern
    2. Servlet Wrapper Classes
    3. Example: AutoCorrect Filter
    4. Summary
  12. Chapter 11: Asynchronous Processing
    1. Overview
    2. Writing Async Servlets and Filters
    3. Writing Async Servlets
    4. Async Listeners
    5. Summary
  13. Chapter 12: Security
    1. Authentication and Authorization
    2. Authentication Methods
    3. Secure Sockets Layer (SSL)
    4. Programmatic Security
    5. Summary
  14. Chapter 13: Deployment
    1. Deployment Descriptor Overview
    2. Deployment
    3. Web Fragments
    4. Summary
  15. Chapter 14: Dynamic Registration and Servlet Container Initializers
    1. Dynamic Registration
    2. Servlet Container Initializers
    3. Summary
  16. Chapter 15: The Spring Framework
    1. Getting Spring
    2. Dependency Injection
    3. XML-Based Spring Configuration
    4. Using the Spring IoC Container
    5. Summary
  17. Chapter 16: Model 2 and the MVC Pattern
    1. Model 1 Overview
    2. Model 2 Overview
    3. Model 2 with A Servlet Controller
    4. Isolating Code in Controller Classes
    5. Validators
    6. The Back End
    7. Summary
  18. Chapter 17: Introduction to Spring MVC
    1. The Benefits of Spring MVC
    2. Spring MVC DispatcherServlet
    3. The Controller Interface
    4. Your First Spring MVC Application
    5. The View Resolver
    6. Summary
  19. Chapter 18: Annotation-Based Controllers
    1. Spring MVC Annotation Types
    2. Writing Request-Handling Methods
    3. Using An Annotation-Based Controller
    4. Dependency Injection with @Autowired and @Service
    5. Redirect and Flash Attributes
    6. Request Parameters and Path Variables
    7. @ModelAttribute
    8. Summary
  20. Chapter 19: Data Binding and the Form Tag Library
    1. Data Binding Overview
    2. The Form Tag Library
    3. Data Binding Example
    4. Summary
  21. Chapter 20: Converters and Formatters
    1. Converters
    2. Formatters
    3. Choosing Between Converters and Formatters
    4. Summary
  22. Chapter 21: Validators
    1. Validation Overview
    2. Spring Validators
    3. The ValidationUtils Class
    4. A Spring Validator Example
    5. A JSR 303 Validator Example
    6. Summary
  23. Chapter 22: Internationalization
    1. Locales
    2. Internationalizing Spring MVC Applications
    3. Summary
  24. Chapter 23: File Upload
    1. Client Side Programming
    2. The MultipartFile Interface
    3. File Upload with Commons FileUpload
    4. File Upload with Servlet 3 or Later
    5. Upload Clients
    6. Summary
  25. Chapter 24: File Download
    1. File Download Overview
    2. Example 1: Hiding A Resource
    3. Example 2: Preventing Cross-Referencing
    4. Summary
  26. Appendix A: Tomcat
    1. Downloading and Configuring Tomcat
    2. Starting and Stopping Tomcat
    3. Defining A Context
    4. Defining A Resource
    5. Installing SSL Certificates
  27. Appendix B: Web Annotations
    1. HandlesTypes
    2. HttpConstraint
    3. HttpMethodConstraint
    4. MultipartConfig
    5. ServletSecurity
    6. WebFilter
    7. WebInitParam
    8. WebListener
    9. WebServlet
  28. Appendix C: SSL Certificates
    1. Certificate Overview
    2. The KeyTool Program