You are previewing Java EE 7: The Big Picture.
O'Reilly logo
Java EE 7: The Big Picture

Book Description

The Definitive Guide to Java Platform, Enterprise Edition 7

Java EE 7: The Big Picture uniquely explores the entire Java EE 7 platform in an all-encompassing style while examining each tier of the platform in enough detail so that you can select the right technologies for specific project needs. In this authoritative guide, Java expert Danny Coward walks you through the code, applications, and frameworks that power the platform. Take full advantage of the robust capabilities of Java EE 7, increase your productivity, and meet enterprise demands with help from this Oracle Press resource.

  • Explore the features of the Java servlet model and Java servlet API
  • Create dynamic web content with JavaServer Pages and JavaServer Faces
  • Build websites for nonbrowser clients with JAX-RS
  • Push data to web clients using Java WebSockets
  • Secure web applications
  • Work with web component APIs
  • Maximize enterprise beans for multithreading, asynchronous processes, transactions, and more
  • Access relational databases with the Java Database Connectivity APIs and the Java Persistence API
  • Understand the packaging and deployment mechanisms of Java EE applications
  • Work with Java EE Contexts and Dependency Injection
  • Secure enterprise beans in a Java EE application
  • Enable parallel processing with Java EE concurrency APIs

Table of Contents

  1. Cover
  2. Title Page
  3. Copyright Page
  4. Dedication
  5. Contents
  6. Introduction
  7. 1 The Big Picture
    1. Java EE Architecture
    2. Hello Java EE
      1. Running Hello Java EE
      2. Inside Hello Java EE
      3. Hello to the Major Elements of Java EE
    3. The Many Variations of Java EE Applications
      1. Many Flavors of Web Interface
      2. Many Kinds of Application Logic
      3. Different Ways to Store Application Data
      4. Interfacing with Other Systems
      5. Modularity
      6. Ways to Secure Java EE Applications
    4. Packaging and Deploying the Hello Java EE Application
    5. Java EE Platform and Implementations
    6. Guide to the Rest of the Book
  8. Part I: The Mouthpiece of Java EE: The Web Tier
    1. 2 Java Servlets and Web Applications: Foundations of the Web Tier
      1. The HTTP Protocol
        1. Inside the HTTP Protocol
      2. Introducing Java Servlets
        1. What a Java Servlet Does
        2. How to Create a Java Servlet
        3. Publishing a Java Servlet to the Web Container
      3. Example Java Servlet Application: Photo Application
      4. Understanding the Java Servlet API
        1. The javax.servlet.http.HttpServlet Class
        2. Number of Instances of Java Servlets
        3. The ServletContext
        4. The HttpSession
        5. The RequestDispatcher
      5. Web Applications
        1. Deployment Information for Java Servlets
        2. Servlet Path Mapping
      6. Java Servlets: The Good and the Bad
      7. Summary
    2. 3 Dynamic Web Pages: JSP
      1. JSP Runtime Architecture
      2. A JSP Clock
      3. JSP Syntax
        1. JSP Directives
        2. Using Java Beans from JSPs
      4. The Java Environment for JSPs
      5. JSP Standard Tags
      6. Custom Tag Libraries
        1. Tag Libraries vs. JavaBeans
      7. Expression Language
      8. JSP Photo Album
      9. Summary
    3. 4 Assembling Dynamic Web Pages: JavaServer Faces
      1. Architecture of a JSF Application
        1. Model-View-Controller
        2. Hello JavaServer Faces
        3. JavaServer Faces: Model-View-Controller
      2. JavaServer Faces Tags
        1. UI Component Tags
        2. The PartyPlanner
      3. Java EE Managed Beans
        1. @RequestScoped
        2. @SessionScoped
        3. @ApplicationScoped
        4. @ConversationScoped
        5. @FlowScoped
        6. @ViewScoped
        7. @Dependent
      4. f: Core Tags
        1. Data Validation
        2. Event Handling
        3. Data Converters
      5. JSTL Core Tags
      6. Extensibility and Modularity
      7. Photo Application
      8. Summary
    4. 5 Web Sites for Non-browsers: JAX-RS
      1. What Are RESTful Web Services?
        1. Uses a URI Space to Address Web Service Resources
        2. Uses HTTP Methods for Operations
        3. RESTful Web Service Resources Are Stateless
        4. Use Familiar Formats for Structured Data
      2. The Java API for RESTful Web Services
      3. HelloResource Example: Server Side
      4. Deploying JAX-RS Resources
      5. HelloResource Example and the Rich Client
      6. Content Production
        1. Extending Response Entity Production
        2. @Produces
      7. Content Consumption
        1. @Consumes
      8. Accessing Web Service Context
      9. Exception Mapping
      10. Number of Instances of Resource Classes
      11. Path Mapping
        1. Relative URIs
        2. URI Templates
      12. The Library Service
      13. Summary
    5. 6 Adding Sparkle: Java WebSockets
      1. Introduction to the WebSocket Protocol
      2. The WebSocket Lifecycle
      3. Overview of the Java WebSocket API
        1. WebSocket Annotations
        2. The Java WebSocket API Classes
      4. WebSocket Clock
        1. How Many WebSocket Instances?
      5. Java WebSocket Encoders and Decoders
      6. Message Processing Modes
        1. Receiving Large Messages
        2. Modes for Sending Messages
        3. Asynchronous Sending of Messages
      7. Path Mapping
        1. Accessing Path Information at Runtime
        2. Query Strings and Request Parameters
      8. Deployment of Server Endpoints
      9. The Chat Application
      10. Summary
    6. 7 Securing Web Applications
      1. Security Concepts
      2. Java EE Web Container Security
        1. The Declarative Security Model
        2. Programmatic Security
      3. Photo Application Example
      4. Summary
    7. 8 The Self-Contained Web Site: Java EE Web Application
      1. The WAR File
      2. The URI Space of a Web Application
        1. Static Content
        2. JavaServer Faces
        3. Java Servlets
        4. JavaServer Pages
        5. JAX-RS Resources and Java WebSockets
        6. Summary: Web Components and Their URI Paths
      3. Global Web Components: Web Filters and Web Listeners
        1. Web Filters
        2. Web Listeners
      4. Asynchronous Modes in Web Applications
        1. Asynchronous Java Servlets
        2. Asynchronous Web Resources
      5. Summary
  9. Part II: The Brain of Java EE: The Middle Tier
    1. 9 The Fundamentals of Enterprise Beans
      1. Introduction to Enterprise Beans
        1. RMI/IIOP
        2. HTTP
        3. JMS Protocol
        4. Local Java Method Invocation
        5. Flavors of Enterprise Bean
      2. Hello Enterprise Beans
      3. Flavors of Enterprise Beans
        1. Stateless Session Beans: @Stateless
        2. Stateful Session Beans: @Stateful
        3. Singleton Session Beans: @Singleton
        4. Message-Driven Beans
      4. Exposing Enterprise Beans
        1. Java Methods
        2. Web Services View
      5. Finding Enterprise Beans
        1. Finding Message-Driven Beans
        2. Finding Session Beans
      6. EJB Lifecycle
      7. Packaging Enterprise Beans
      8. Banking Example
      9. Summary
    2. 10 Advanced Thinking with Enterprise Beans
      1. Multi-threading and Enterprise Beans
        1. Multi-threading and Singleton Beans
        2. Threading Restrictions
      2. Asynchronous Enterprise Beans
        1. The Async Example
      3. Enterprise Bean Contexts
      4. The Timer Service
        1. The Language of Schedules
        2. Timers at Runtime
      5. Transactions and Enterprise Beans
        1. Programmatic Transactions
        2. Transaction by Annotation
      6. Interceptors
        1. The AuditInterceptor Example
      7. Summary
  10. Part III: The Collective Memory: The Information Tier
    1. 11 Classic Memories: JDBC
      1. Introduction to JDBC
      2. Hello JDBC Example
      3. Structured Query Language
        1. Statements That Alter Table Structure
        2. Statements That Store or Retrieve Data into and from Tables
      4. The JDBC APIs
        1. The DataSource Object
        2. The Connection Object
        3. Statement Objects
        4. ResultSets
      5. Library Application Using JDBC
      6. Summary
    2. 12 Modern Memories: The Java Persistence API
      1. The Library Service, with Java Persistence
      2. Persistence Entities
        1. Embeddable Classes
        2. Entity Relationships
        3. Persistent States
        4. Cascading in Entity Relationships
      3. The Entity Manager
      4. Java Persistence Query Language
      5. Configuring JPA Applications
      6. The Persistent Library Service
      7. Summary
  11. Part IV: The Java EE Toolbox: Java EE Environment
    1. 13 The Big Picture Revisited: Java EE Applications
      1. The Java EE Application
        1. Web Application WARs
        2. Enterprise Bean JARs
        3. Application Client JARs
        4. Resource Adapter Archives
        5. Java EE Modules
        6. Application Clients
        7. Enterprise Archives: EAR Files
      2. Injectable and Named Objects of Java EE
        1. JNDI Namespaces
        2. Simple Environment Entries
        3. Enterprise Bean References
        4. DataSource
        5. Java Persistence Objects: EntityManager, EntityManagerFactory
        6. Other Named and Injectable Objects
        7. Where Does Injection Work?
      3. Summary
    2. 14 Deconstructing Components: Java EE Contexts and Dependency Injection
      1. Introduction to CDI
        1. Goldilocks and the Three Bears
      2. CDI Beans
        1. Examples
      3. Qualifiers
        1. @Default
        2. @Named
      4. Injection Points
      5. Lifecycle of a CDI Bean
        1. @PostConstruct
        2. @PreDestroy and @Disposes
      6. Java EE Scopes
      7. SleepScopes example
      8. Events
        1. Goldilocks Observed
      9. Interceptors
      10. Packaging CDI Beans
      11. CDI Chat
      12. Summary
    3. 15 Java EE Security
      1. Enterprise Bean Security
        1. Declarative Security
        2. Declarative Security Example
        3. Programmatic Security
      2. Application Client Authentication
      3. Security Identity Propagation
      4. The Library Example with End-to-End Security
      5. Summary
    4. 16 Many Hands Make Light Work: Java EE Concurrency
      1. Tasks and Executors
      2. Concurrent Prime Calculator
        1. Running the Concurrent Prime Calculator
        2. Architecture of the Concurrent Prime Calculator Example
        3. Code Analysis
      3. The Java EE Concurrency API
        1. ManagedExecutorService and ManagedScheduledExecutorService
        2. Obtaining a ManagedExecutorService instance
        3. Identifying and Monitoring Concurrent Tasks
        4. The ManagedThreadFactory
      4. Monitored Prime Calculator Example
        1. Running the Monitored Prime Calculator
        2. Architecture of the Monitored Prime Calculator
      5. Summary
  12. Index