WA1540 Java EE 5 Programming Using NetBeans IDE 5.5 Training and Courseware Course Outline
|
|
1. Introduction to NetBeans IDE
|
|
- Objectives
- NetBeans 5.5 IDE
- Projects Window
- Source Editor
- Files Window
- Runtime Window
- Navigator Window
- Output Window
- Standard Projects
- Free-Form Projects
- Templates
- Building, Running, and Debugging Projects Using Ant
- Setting Main Project
- Opening and Closing Projects
- Code Completion
- Searching
- Setting Project’s Class Path
- Setting Project’s Target JDK
- Summary
|
| |
2. Introduction to Java EE 5
|
|
- Objectives
- Java Web Applications
- Java Web Application Architecture
- J2EE Architecture
- J2EE Software Packaging
- Deployment Descriptors
- J2EE Module Structure
- Enterprise Archive (EAR)
- Web Modules and WAR
- EJB Modules
- Web Application Programming Model – MVC
- An MVC Example
- The Infrastructure for Enterprise Web Applications
- Summary
|
| |
3. J2EE Programming Tools in NetBeans IDE
|
|
- Objectives
- Create an Enterprise Application Project
- Setup Utility JAR
- Create an EJB Module Project
- Create a Web Application Project
- Setup Dependent JAR Files
- Register a Server
- Select Server An Application Runs On
- Start and Stop the Server
- Test a Servlet
- Debug a Servlet
- Test a JSP
- Debug a JSP
- Summary
|
| |
4. Servlet Basics
|
|
- Objectives
- History – CGI
- Server Extension APIs
- Java Servlet
- Servlet Container
- Servlet Responsibilities
- J2EE and Servlet
- The Servlet Class
- The HttpServlet Class
- An Example – Hello World
- The Servlet Container
- The Servlet API
- Life Cycle – Initialization
- Example Initialization
- Life Cycle – Processing
- Life Cycle – Destroy
- User Input
- Example – User Input
- Output to Client
- Servlet Error Handling
- Threading Issues
- Registering a Servlet in the Web Deployment Descriptor
- Create a Servlet in NetBeans
- Code Servlet Methods
- The Web Deployment Descriptor
- Test the Servlet
- Debug Servlets
- Summary
|
| |
5. JavaServer Page (JSP) Basics
|
|
- Objectives
- JavaServer Pages
- A Simple Example - Hello.jsp
- JSP Benefits
- Evolution of Dynamic Content Technologies
- How JSP Works
- JSP Invocation
- JSP Scripting Elements
- JSP Directive
- page Directive Attributes
- page Directive – an Example
- page Attribute – errorPage
- page Attribute – isErrorPage
- Directives – include
- Include – an Example
- Include at compile time vs. at request time
- Request time inclusion
- 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
- Out – an Example
- Creating a JSP with NetBeans
- Editing a JSP with NetBeans
- Testing a JSP with NetBeans
- Debugging a JSP with NetBeans
- Summary
|
| |
6. Servlet Interaction Interface
|
|
- Objectives
- Request
- Request Parameters
- Request Attributes
- Request Headers
- Request Path
- Other Request Information
- Response
- Cookies
- Setting Cookies
- Servlet Context
- Servlet Context Attributes
- Resource
- Session Tracking
- Tracking Techniques
- Cookies
- Cookies – an Example
- HTML Hidden Fields
- Using HttpSession
- Session Invalidation
- An Example of Session Tracking Code...
- An Example of Session Tracking Code…
- HttpSession - URL Rewriting
- Summary
|
| |
7. Unified Expression Language and JSP Standard Tag Library (JSTL)
|
|
- Objectives
- Unified Expression Language
- Basic Usage
- Built-in Objects
- Working With Arrays and Maps
- Operators
- Full Example
- JSP Standard Template Library (JSTL)
- Run Time Version
- Basic Tags
- Condition Tags
- Iterator Tags
- Internationalization (I18N)
- Setting Preferred Locale
- Specifying Resource Bundle
- Display Translated Text
- Display Number
- Display Date
- JDBC Tags
- Specify Data Source
- Performing a Query
- Display Result
- Pagination Example
- Deferred Expressions
- Summary
|
| |
8. Servlet Programming – Advanced
|
|
- Objectives
- Key Issues for Web Application Development Productivity
- Web Application Programming Model – MVC
- Model
- View
- Controller
- What is JDBC?
- JDBC Architecture
- JDBC: Basic Steps
- Loading a Driver
- DB2 UDB JDBC Drivers
- Oracle JDBC Drivers
- Create a Connection
- Connection
- Statement
- PreparedStatement
- ResultSet
- ResultSet…
- Example JDBC Servlet With Transactions
- Close the Connection
- Need for Connection Pooling
- Connection Pooling in JDBC 2.0
- Connection Pooling
- Basic Steps in Using JDBC Connection Pooling
- Access a DataSource
- Get a Connection
- Release Connections
- Connection Pool Example
- Resource References
- JavaBeans
- MVC Implementation
- Request Dispatching
- Request Dispatching - Forward vs. Include
- HTTP Redirection
- Dispatch vs. redirection
- Integrating Servlet and JSP
- Calling a JSP from a Servlet
- Request Dispatching - forward Request to JSP
- Supply Result information to the JSP
- A Simple Example
- Display JavaBean Properties in JSP
- Creating a Data Source with NetBeans
- Adding Resource Reference in NetBeans
- Create a Java Bean with NetBeans
- Add Attributes and Getters and Setters with NetBeans
- Summary
|
| |
9. J2EE Annotations
|
|
- Objectives
- What are Annotations?
- Java Metadata Specification (JSR-175)
- Where Can Annotations Be Used?
- @EJB, @EJBs
- @PersistenceContext, @PersistenceContexts
- @PersistenceUnit, @PersistenceUnits
- @PostConstruct, @PreDestroy
- @Resource, @Resources
- @WebServiceRef, @WebServiceRefs
- Summary
|
| |
10. Enterprise JavaBeans (EJBs) Overview
|
|
- Objectives
- Need for EJBs
- Distributed Computing
- Distributed Transaction
- Distributed Security
- What are EJBs?
- Main Characteristics of EJBs
- EJB Remote Method Call
- EJB Architecture Components
- EJB Client
- EJB JAR File
- EJB Container
- EJB Server
- Enterprise JavaBeans
- Session Beans
- Entity Beans
- Java Persistence API - Entities
- Message-Driven Beans (MDBs)
- EJB Specification
|
| |
11. Stateless Session Beans
|
|
- Objectives
- Session Beans
- Stateless Session Bean
- Stateless Session Bean Pooling
- Stateless Session Bean Examples
- Stateful Session Bean
- Stateful Session Bean Examples
- Annotations
- Stateless Session Bean Components
- Example: Business Interface
- Example: Bean Class
- Alternative Example
- Example: The Client
- Business Interface Details
- Bean Class Details
- JNDI - Overview
- Dependency Injection
- Dependency Annotations
- Injecting EJB References (@EJB)
- Injecting EJB References (@EJB) - Field Level Injection
- Injecting EJB References (@EJB) - Method Level Injection
- The @Resource Annotation
- Injecting Resources (@Resource) - Field Level Injection
- Injecting Resources (@Resource) - Method Level Injection
- A Full Example
- Session Bean Lifecycle
- Stateless Session Bean Lifecycle
- Summary
|
| |
12. Stateful Session Beans
|
|
- Objectives
- Stateful Session Bean
- Stateful Session Bean Examples
- Stateful Session Bean Components
- Stateful Session Bean Example
- Stateful Session Beans
- Session Bean Lifecycle
- Stateful Session Bean Lifecycle
- Summary
|
| |
13. Entities and Java Persistence API
|
|
- Objectives
- Data Persistence
- Java Persistence API
- Entities
- Session Beans Vs Entities
- Entities
- Persisting and Retrieving Data
- Entities - Example
- Descriptor File META-INF/persistence.xml
- Accessing Entities
- Persistence Context
- Working With the EntityManager Interface
- Accessing Entities Using Stateless Session Beans
- Updating Data
- Entity Lifecycle
- Life-Cycle Callbacks
- Example: Internal callback
- External Callback Class
- Listener Class - Example
- Synchronizing with Databases
- Entity Lookup
- EJBQL (EJB Query Language)
- EJB Query Language
- EJBQL: Simple examples
- EJBQL: SELECT clause
- EJBQL: SELECT clause
- EJBQL: FROM clause
- EJBQL: WHERE clause
- EJBQL: WHERE clause
- Using EJBQL - Dynamic Query
- Using EJBQL - Named Query
- Summary
|
| |
14. Best Practices
|
|
- Objectives
- Stateful Session Beans
- Transaction Isolation Levels
- Which EJB objects to cache
- Caching and Pooling Entities
- Using HTTP Session
- Connection Pooling
- Java Best Practices
- Summary
|
| |
15. Deploying Enterprise Application Projects to Sun Java System Application Server 9
|
|
- Objectives
- Exporting the Enterprise Application
- Deployment Descriptors
- Application Assemble Entries
- Installing an Application into Sun Java System Application Server 9
- Managing Applications
- Summary
|
| |
16. J2EE Design Patterns
|
|
- Objectives
- EJB Layer Architectural Patterns
- Inter-tier Data Transfer Patterns
- Transaction and Persistence Patterns
- Client-side EJB Interaction Patterns
- Primary Key Generation Strategies
- Summary
|
| |
Appendix A. Message-Driven Beans
|
|
- Objectives
- The Trouble with RMI/IIOP
- Messaging to the Rescue
- Messaging Features
- Message-Oriented Middleware
- Messaging Domains
- Publish/Subscribe
- Point-to-Point
- Java Message Service
- JMS Programming: Overview
- JMS Programming: Overview
- The JMS Interfaces
- Integrating JMS and EJB
- Message-Driven Beans Are Different From Other EJBs
- Message-Driven Beans Cannot Talk to Their Clients
- Message-Driven Beans are Stateless
- Durable Subscription
- Message-Driven Bean Interfaces
- javax.jms.MessageListener
- javax.jms.Message
- Specialized Message Types
- Lifecycle
- Message Driven Bean - Example
- Message Driven Bean - Client Example (JSP)
- Transactions
- Security
- Load Balancing
- Clustering and Topics
- Clustering and Queues
- A Few Tips
- Poison Messages
- How the Programmer Can Avoid Poison Messages
- How the System Administrator Can Avoid Poison Messages
- Building a Response
- Potential Problems
- A Simple Alternative
- Type Checking and Messages
- Testing Message-Driven Beans
- Summary
- References
|
| |
Appendix B. Simple Custom Tags
|
|
- Objectives
- What are Custom Tags (a.k.a. Tag Extensions)?
- Motivation
- Simple Tags, Tag Files, and Classic Tags
- Simple Tag Handlers
- Tag Attributes
- Tag Body
- Tag Library Descriptor
- Tag Library Descriptor Details
- carPrice.tld
- The Java Server Page
- Writing a Simple Tag Handler Class
- Simple Tag Handler Life Cycle
- Rendering Content
- Implementing Empty Body Tag
- Example: CarPriceHandler
- carPrice.jsp
- Implementing a Tag With Unprocessed Body
- Handling Tag Bodies
- Implementing Body Processing
- Example: Body Tag Support
- Implementing an Iteration Tag
- Nested Tags
- Summary
|
| |
Appendix C. Java Messaging Service
|
|
- Objectives
- Introduction
- Messaging Models
- Components of Point-to-Point Messaging
- Implementing a Sender
- Example Sender Servlet
- Example Sender Stateless Session EJB
- Listener Types
- Listener Design Decisions
- Implementing a JMS Receiver
- Example: Synchronous Receipt
- Components of a Pub-Sub Model
- Example Topic Publisher
- JMS Programming in NetBeans
- Summary
|
| |