WA2172

Java EE 6 Programming - WebSphere 8.5 / Eclipse Training

For those new to Java EE programming this course is an excellent introduction to the various technologies included in the Java EE 6 platform. Developing web applications using JSF, business logic and persistence using EJB and JPA, performing dependency injection between components using CDI, and implementing web services using JAX-WS and JAX-RS are some of the topics covered in this class. After completing this course participants will have a good foundational knowledge of the various major technologies of the Java EE platform and what they can be used for. This course is also good for those with experience in J2EE 1.4 or earlier as the last two versions of Java EE have seen many major changes.
Course Details

Duration

5 days

Prerequisites

Experience with Java programming is required.

Target Audience

Software designers, developers and programmers new to Java EE or with J2EE 1.4 or earlier experience

Skills Gained

  • Have an overview of the Servlet/JSP web technologies
  • Develop web based applications using JavaServer Faces
  • Develop business logic layer using EJB 3.1
  • Persist data using Java Persistence (JPA) 
  • Use CDI (Contexts and Dependency Injection) to perform type-safe dependency injection of components
  • Use the JSF 2.0 integration with CDI including the CDI support of \"conversational\" web applications
  • Define standardized data validation constraints with JSR 303 Bean Validation
  • Learn the two major web service implementation choices, JAX-WS and JAX-RS, available in Java EE 6
Course Outline
  • Overview of Java EE 6
    • Java Platforms
    • Community Innovation
    • A Whole New Java EE Platform
    • The Java EE Specifications
    • Major Java EE Technologies
    • Java EE Application Packaging
    • Java Web Applications
    • Java Persistence
    • Java EE Business Components
    • Dependency Injection
    • Java Web Services
    • Java EE Application Architecture
    • Java EE Architecture Example
  • Overview of Servlets
    • Java Servlet
    • Java EE and Servlet
    • New In Servlet 3.0
    • Servlet Responsibilities
    • The Servlet Container
    • The Servlet Class
    • The HttpServlet Class
    • Servlet Configuration – web.xml
    • Servlet Configuration – Annotations
    • Life Cycle – Request Processing
    • User Input
    • Example – User Input
    • Request
    • Request Parameters
    • Request Attributes
    • Response
    • Tracking User State
    • Tracking Techniques
    • Using HttpSession
    • Session Invalidation
  • Overview of JavaServer Pages (JSP)
    • JavaServer Pages
    • A Simple Example - Hello.jsp
    • JSP Benefits
    • How JSP Works
    • JSP Scripting Elements
    • JSP Directive
    • JSP Declarations
    • Declarations – an Example
    • JSP Expressions
    • JSP Expressions – an Example
    • JSP Scriptlets
    • JSP Scriptlets – an Example
    • JSP Comments
    • JSP Predefined Variables
    • The request Object
    • The response Object
    • The out Object
    • MVC Implementation
    • Request Dispatching - Forward Request to JSP
    • Using Java Beans in JSP
    • JSPs as Error Pages
  • Introduction to JavaServer Faces 2.0
    • What is JavaServer Faces (JSF)?
    • Why Use JSF?
    • Nature of a JSF Application
    • JSF Implementations
    • JSF and MVC
    • Faces Servlet
    • Faces Servlet URL Mapping
    • Managed Bean
    • The View Layer
    • XML Validity of a Page
    • A Simple JSF Application
    • The Input Form: form.xhtml
    • The Result: thanks.xhtml
    • The Controller: AddressBean
    • How Does the Application Work?
    • Under the Covers: The Rendered Form HTML
    • Under the Covers: The Layout Tree
  • Basic JSF User Interface Components
    • JSF UI Components
    • JSF UI Tags
    • A Basic Page
    • Define a Form
    • Labels and Images
    • Button
    • Links
    • Output Link
    • Text Input
    • Simple Check Box
    • Check Box Group
    • Check Box Group Example
    • Radio Button
    • List Boxes
    • Multiple Selection List Box
    • Dynamic List Box
    • Example
    • Component Identifier
    • Showing and Hiding Components
    • Other Common Attributes
    • Adding JavaScript and Stylesheet
  • Basic Managed Bean and JSF Expression and Scope
    • Introduction
    • JSF Expression Language (EL)
    • Simple Value Property
    • Complex Value Property
    • Method Expression
    • Managed Bean Scopes
    • Implications of Various Scopes
    • View Scoped Managed Beans
    • Defining Managed Bean Scope
    • Getting Rid of the Session
    • Application Scope
    • "None" Scope
    • Custom Scopes
  • JSF Event Handling
    • Request Processing Phases
    • Action Request Processing Phases
    • JSF Event & Listener Model…
    • JSF Event Classes
    • Event Classes
    • Event Classes: Hierarchy
    • Action Event Handling
    • Action Event: Example
    • Action Listener
    • Passing Arguments
    • Value Change Event
    • Value Change Event Handler
    • Listener Classes
    • Listener Interfaces
    • Listener Classes: Hierarchy
    • Action Listener Class
    • Value Change Listener Class
    • Phase Event Listener
    • Request Processing Lifecycle
    • Phase Identifiers
  • JSF Navigation
    • JSF Navigation
    • Example Action Event Handler
    • Implicit Navigation
    • Pros and Cons of Implicit Navigation
    • Defining Rules in faces-config.xml File
    • Stating the Source View ID
    • Stating the Action Handler Method
    • Global Rule
    • Doing Redirection
    • Implementing Redirection
    • Conditional Navigation
    • Preemptive Navigation
  • Advanced JSF User Interface Components
    • HTML Panel
    • Applying Styles
    • Grouping Components
    • Data Table
    • Using a Data Table
    • Displaying a Header and Footer Row
    • Applying Styles
    • Adding Links to a Row
    • Handling Action
  • Advanced Managed Beans
    • @ManagedProperty Annotation
    • Value Binding
    • Property Data Conversion
    • Advanced Property Types
    • Component Binding
    • Predefined Objects
  • Overview of Contexts and Dependency Injection
    • Once upon a time
    • What is CDI?
    • The JSRs
    • CDI Example
    • What Good is DI
    • Old Bean Scope
    • CDI Bean Scope
    • Other Advanced Features of CDI
    • CDI Implementation
  • Defining CDI Beans
    • Requirements of Bean Classes
    • Bean Initialization Methods
    • beans.xml
    • Managed Bean Type
    • Using Beans with EL
    • Beans Have Default Names
    • Bean Scopes
    • EJBs in CDI
  • JSF Integration, Scope and Context
    • CDI Beans in JSF
    • JSF Example
    • Introduction to Scopes
    • Normal and Pseudo- scopes
    • Declaring Scope of a Bean
    • Scope Boundaries
    • Instance Sharing
    • How Dependent Scope Works
    • Forcing a Dependent Instance
    • Conversation Scope
    • Use Cases of Conversation Scope
    • Starting and Ending Conversations
    • Propagating Conversations
    • Conversations and HttpSession
  • JSR 303 Bean Validation
    • Validation in Applications
    • Using Validation
    • Built-in Validation Constraints
    • Using Constraints
    • Showing Error Messages in JSF
    • Custom Validation Messages
    • Externalizing Validation Messages
    • External Message Example
    • Defining Custom Constraints
    • Custom Constraint Example
    • Interface
    • Validator
    • Custom Constraint in JSF
    • Bootstrapping Validation
    • The Validator API
    • Validation Groups
    • Group Example
    • Using Bean Validation in JPA 2.x and JSF 2.x
  • JSF GET Requests and View Parameters
    • Using GET Requests with JSF
    • POST-Redirect-GET (PRG) Pattern
    • Implementing PRG Pattern With JSF
    • Defining View Parameters
    • New and Tags
    • Passing Request Parameters
    • Passing Request Parameters from POST Action Methods
    • Causing Redirection
    • Using a PreRenderView Event
    • The Flash Object
  • Overview of Enterprise JavaBeans (EJB)
    • What are EJBs?
    • Distributed Transaction
    • Distributed Security
    • Distributed Computing
    • Main Characteristics of EJBs
    • EJB Container
    • EJB Client
    • Annotations
    • Enterprise JavaBeans
    • Session Beans
    • Message-Driven Beans (MDBs)
    • Asynchronous Session EJBs
    • EJB Timers
    • EJB Lite
    • EJB Packaging
    • EJBs are Simple!
  • Overview of Java Persistence API
    • Data Persistence
    • Java Persistence API 2.0
    • Entities
    • Session EJB vs JPA Entities
    • Entities
    • Persisting and Retrieving Data
    • Accessing Entities
    • EntityManager & Persistence Unit
    • Persistence Context
    • Entities - Example
    • persistence.xml – Hibernate Provider
    • persistence.xml – Open JPA Provider
    • persistence.xml - Toplink
    • Entity Instance Lifecycle
    • Creating EntityManager in Session EJB
    • Creating EntityManager in a Plain Java Class
    • Working With the EntityManager Interface
    • Transaction Basics
  • Using AJAX with JSF
    • Integrated AJAX Support in JSF 2.0
    • Challenges of AJAX with JSF
    • AJAX Handling in JSF 2.0
    • Request Lifecycle for AJAX Requests
    • JSF JavaScript API
    • New Tag
    • Partial Page Rendering
    • Third Party JSF Libraries with AJAX
    • Component Libraries Available
  • Facelet Templates
    • Page Templates
    • Define a Page Template
    • Define a Template Client
    • Run the Template Client
    • Server Side Include
    • Removing Portions of a Page
    • Looping
  • Facelets Composite Components
    • Introduction
    • The Basics
    • Basic Structure of a Composite XHTML
    • Defining the Interface
    • Defining the Implementation
    • Using the Component
    • Parameterizing the Controller
    • Supplying a Controller
  • Internationalization (I18N)
    • Internationalization
    • I18N
    • Locales
    • Default Locales
    • Resource Bundles
    • Updating faces-config.xml
    • Loading the Bundle
    • Display Localized Text
    • Example – Resource Bundles
    • Update faces-config.xml
    • JSF Page
    • View the JSF Page
    • Benefits
    • Parameterized Messages
    • Displaying Parameters
    • Parameterized Messages
  • Stateless Session EJB
    • Stateless Session Bean
    • Stateless Session Bean Components
    • Example: Business Interface
    • Example: Bean Class
    • Business Interface Details
    • Using an EJB in a Client
    • Portable JNDI Syntax
    • No-interface EJB
    • Stateless Session Bean Lifecycle
    • Stateless Session Bean Initialization
  • Stateful Session EJB
    • Stateful Session Bean
    • Stateful Session Beans
    • Session Bean Lifecycle
    • Stateful Session Bean Lifecycle
    • Stateful Session Bean Example
    • Stateful Session Bean Client
    • Removing the Bean
    • Why Use Stateful Session EJBs?
    • Stateful Session EJB and Transactions
  • Overview of Java Persistence API
    • Data Persistence
    • Java Persistence API 2.0
    • Entities
    • Session EJB vs JPA Entities
    • Entities
    • Persisting and Retrieving Data
    • Accessing Entities
    • EntityManager & Persistence Unit
    • Persistence Context
    • Entities - Example
    • persistence.xml – Hibernate Provider
    • persistence.xml – Open JPA Provider
    • persistence.xml - Toplink
    • Entity Instance Lifecycle
    • Creating EntityManager in Session EJB
    • Creating EntityManager in a Plain Java Class
    • Working With the EntityManager Interface
    • Transaction Basics
  • JPA Entity Lifecycle
    • Entity Lifecycle
    • When is an Entity Managed or Detached?
    • Implementing the CRUD Pattern
    • Accessing Entities Using Stateless Session Beans
    • Inserting Data
    • Retrieving Data
    • Updating Data
    • Deleting Data
    • Merging Entities
    • Merging Entities (example)
    • Life-Cycle Callbacks
    • Example: Internal callback
    • External Callback Class
    • Listener Class - Example
    • Synchronizing with Databases
    • Entity Lookup
    • JPAQL (JPA Query Language)
  • Java Persistence Query Language (JPA QL)
    • JPA Query Language
    • Basic JPAQL Syntax
    • Simple SELECT Examples
    • Example of Using JPAQL
    • The SELECT clause
    • Reading Data from Code
    • The WHERE Clause
    • Example Using JPAQL from Session EJB
    • Named Query
    • Multiple Named Queries
    • TypedQuery
    • Bulk Updates
    • Bulk Delete
    • Running Native SQL Query
    • Native SELECT Query
    • Native SQL Delete and Insert
    • Named Native Query
  • Basic JPA Entity Relationships
    • Relationship Between Entities
    • Anatomy of a Relationship
    • Foreign Key
    • Example Schema
    • One-to-One Unidirectional
    • Creating Entity Instances
    • Traversing the Relationship
    • The Cascade Behavior
    • One-to-One Bidirectional
    • Maintaining Bidirectional Links
    • Simplifying Bidirectional Links
    • Traversing the Relationship
  • Lab Exercises
    • Lab 1. Configure the Development Environment
    • Lab 2. Basic JSF Application
    • Lab 3. Develop a Managed Bean
    • Lab 4. More User Interface Design
    • Lab 5. Basic Event Handling
    • Lab 6. Build a TODO List Application
    • Lab 7. Enhance TODO List Application
    • Lab 8. Navigation
    • Lab 9. Using a Data Table
    • Lab 10. Basic Dependency Injection
    • Lab 11. JSF and CDI Integration
    • Lab 12. Using the Conversation Scope
    • Lab 13. Input Validation Using JSR 303
    • Lab 14. JSF GET Requests
    • Lab 15. Creating A Stateless Session Bean
    • Lab 16. Creating A Stateful Session Bean
    • Lab 17. Accessing A Database From A Session Bean
    • Lab 18. Using Entities
    • Lab 19. JPA Entity Lifecycle
    • Lab 20. Entity Queries
    • Lab 21. Basic Relationships