JavaEE 6 Tutorial.pdf
(
11994 KB
)
Pobierz
The Java EE 6 Tutorial
TheJavaEE6Tutorial
Part No: 821–1841–12
March 2011
Copyright © 2011, Oracle and/or its aliates. All rights reserved.
Copyright and License: The Java EE 6 Tutorial
This tutorial is a guide to developing applications for the Java Platform, Enterprise Edition and contains documentation ("Tutorial") and sample code. The "sample
code" made available with this Tutorial is licensed separately to you by Oracle under the
Berkeley license
.
If you download any such sample code, you agree to the
terms of the Berkeley license.
This Tutorial is provided to you by Oracle under the following license terms containing restrictions on use and disclosure and is protected by intellectual property
laws. Oracle grants to you a limited, non-exclusive license to use this Tutorial for information purposes only, as an aid to learning about the Java EE platform. Except
as expressly permitted in these license terms, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish,
or display any part, in any form, or by any means this Tutorial. Reverse engineering, disassembly, or decompilation of this Tutorial is prohibited.
The information contained herein is subject to change without notice and is not warranted to be error-free. If you nd any errors, please report them to us in writing.
If the Tutorial is licensed on behalf of the U.S. Government, the following notice is applicable:
U.S. GOVERNMENT RIGHTS Programs, software, databases, and related documentation and technical data delivered to U.S. Government customers are
"commercial computer software" or "commercial technical data" pursuant to the applicable Federal Acquisition Regulation and agency-specic supplemental
regulations. As such, the use, duplication, disclosure, modication, and adaptation shall be subject to the restrictions and license terms set forth in the applicable
Government contract, and, to the extent applicable by the terms of the Government contract, the additional rights set forth in FAR 52.227-19, Commercial
Computer Software License (December 2007). Oracle USA, Inc., 500 Oracle Parkway, Redwood City, CA 94065.
This Tutorial is not developed or intended for use in any inherently dangerous applications, including applications which may create a risk of personal injury. If you
use this Tutorial in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure the safe
use.
THE TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ORACLE FURTHER DISCLAIMS ALL WARRANTIES, EXPRESS AND
IMPLIED, INCLUDING WITHOUT LIMITATION, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
OR NONINFRINGEMENT.
IN NO EVENT SHALL ORACLE BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, PUNITIVE OR CONSEQUENTIAL DAMAGES, OR
DAMAGES FOR LOSS OF PROFITS, REVENUE, DATA OR DATA USE, INCURRED BY YOU OR ANY THIRD PARTY, WHETHER IN AN ACTION IN
CONTRACT OR TORT, EVEN IF ORACLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. ORACLE'S ENTIRE LIABILITY FOR
DAMAGES HEREUNDER SHALL IN NO EVENT EXCEED ONE THOUSAND DOLLARS (U.S. $1,000).
No Technical Support
Oracle's technical support organization will not provide technical support, phone support, or updates to you.
Oracle and Java are registered trademarks of Oracle and/or its aliates. Other names may be trademarks of their respective owners.
The sample code and Tutorial may provide access to or information on content, products, and services from third parties. Oracle Corporation and its aliates are
not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services. Oracle Corporation and its aliates
will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services.
110225@25097
Contents
Preface
...................................................................................................................................................29
PartI Introduction
.........................................................................................................................................33
1 Overview
...............................................................................................................................................35
Java EE 6 Platform Highlights ............................................................................................................ 36
Java EE Application Model ................................................................................................................. 37
Distributed Multitiered Applications ............................................................................................... 37
Security .......................................................................................................................................... 39
Java EE Components ................................................................................................................... 40
Java EE Clients .............................................................................................................................. 40
Web Components ........................................................................................................................ 42
Business Components ................................................................................................................. 43
Enterprise Information System Tier .......................................................................................... 44
Java EE Containers .............................................................................................................................. 45
Container Services ....................................................................................................................... 45
Container Types ........................................................................................................................... 46
Web Services Support ......................................................................................................................... 47
XML ............................................................................................................................................... 47
SOAP Transport Protocol ...........................................................................................................48
WSDL Standard Format ..............................................................................................................48
Java EE Application Assembly and Deployment ............................................................................. 48
Packaging Applications ...................................................................................................................... 49
Development Roles ............................................................................................................................. 50
Java EE Product Provider ............................................................................................................ 51
Tool Provider ................................................................................................................................ 51
Application Component Provider ............................................................................................. 51
3
Contents
Application Assembler ................................................................................................................ 52
Application Deployer and Administrator ................................................................................. 52
Java EE 6 APIs ...................................................................................................................................... 53
Enterprise JavaBeans Technology .............................................................................................. 56
Java Servlet Technology .............................................................................................................. 57
JavaServer Faces Technology ...................................................................................................... 57
JavaServer Pages Technology ..................................................................................................... 58
JavaServer Pages Standard Tag Library ..................................................................................... 58
Java Persistence API ..................................................................................................................... 58
Java Transaction API ................................................................................................................... 59
Java API for RESTful Web Services ........................................................................................... 59
Managed Beans ............................................................................................................................ 59
Contexts and Dependency Injection for the Java EE Platform (JSR 299) ............................. 59
Dependency Injection for Java (JSR 330) .................................................................................. 60
Bean Validation ............................................................................................................................ 60
Java Message Service API ............................................................................................................ 60
Java EE Connector Architecture ................................................................................................ 60
JavaMail API ................................................................................................................................. 61
Java Authorization Contract for Containers ............................................................................ 61
Java Authentication Service Provider Interface for Containers ............................................. 61
Java EE 6 APIs in the Java Platform, Standard Edition 6.0 .............................................................. 62
Java Database Connectivity API ................................................................................................. 62
Java Naming and Directory Interface API ................................................................................ 62
JavaBeans Activation Framework .............................................................................................. 63
Java API for XML Processing ..................................................................................................... 63
Java Architecture for XML Binding ........................................................................................... 63
SOAP with Attachments API for Java ........................................................................................ 63
Java API for XML Web Services ................................................................................................. 64
Java Authentication and Authorization Service ....................................................................... 64
GlassFish Server Tools ........................................................................................................................ 64
2 UsingtheTutorialExamples
..............................................................................................................67
Required Software ............................................................................................................................... 67
Java Platform, Standard Edition ................................................................................................. 67
Java EE 6 Software Development Kit ......................................................................................... 68
4
TheJavaEE6Tutorial • March2011
Contents
Java EE 6 Tutorial Component ................................................................................................... 68
NetBeans IDE ............................................................................................................................... 69
Apache Ant ................................................................................................................................... 70
Starting and Stopping the GlassFish Server ...................................................................................... 71
Starting the Administration Console ................................................................................................72
▼
To Start the Database Server Using NetBeans IDE .................................................................. 72
Building the Examples ........................................................................................................................ 73
Tutorial Example Directory Structure .............................................................................................. 73
Getting the Latest Updates to the Tutorial ....................................................................................... 74
▼
To Update the Tutorial Through the Update Center .............................................................. 74
Debugging Java EE Applications ....................................................................................................... 74
Using the Server Log .................................................................................................................... 74
Using a Debugger ......................................................................................................................... 75
PartII TheWebTier
.........................................................................................................................................77
3 GettingStartedwithWebApplications
...........................................................................................79
Web Applications ................................................................................................................................ 79
Web Application Lifecycle ................................................................................................................. 81
Web Modules: The hello1 Example ................................................................................................. 83
Examining the hello1 Web Module ......................................................................................... 84
Packaging a Web Module ............................................................................................................ 87
Deploying a Web Module ........................................................................................................... 88
Running a Deployed Web Module ............................................................................................ 89
Listing Deployed Web Modules ................................................................................................. 89
Updating a Web Module ............................................................................................................. 90
Dynamic Reloading ..................................................................................................................... 90
Undeploying Web Modules ........................................................................................................ 91
Conguring Web Applications: The hello2 Example ................................................................... 92
Mapping URLs to Web Components ........................................................................................ 92
Examining the hello2 Web Module ......................................................................................... 92
Building, Packaging, Deploying, and Running the hello2 Example .................................... 94
Declaring Welcome Files ............................................................................................................ 95
5
To Start the Administration Console in NetBeans IDE .......................................................... 72
Starting and Stopping the Java DB Server ......................................................................................... 72
▼
Plik z chomika:
mariuszs80
Inne pliki z tego folderu:
JavaEE 6 Tutorial.pdf
(11994 KB)
Inne foldery tego chomika:
Pliki dostępne do 01.06.2025
Pliki dostępne do 08.07.2024
Pliki dostępne do 19.01.2025
Pliki dostępne do 27.02.2021
Dokumenty
Zgłoś jeśli
naruszono regulamin