SlideShare a Scribd company logo
T ng quan J2EEổ
ThS Văn Thiên Hoàng
M c đíchụ
Gi i thi u t ng quan v công ngh J2EE.ớ ệ ổ ề ệ
Bi t các thành ph n J2EEế ầ
J2EE là gì?
Challenges
Portability
Diverse
Environments
Time-to-market
Core Competence
Assembly
Integration
Key
Technologies
J2SE™
J2EE™
JMS
Servlet
JSP
Connector
XML
Data
Binding
XSLT
Products
App Servers
Web Servers
Components
Databases
Object to DB
tools
Legacy
Systems
Databases
TP Monitors
EIS Systems
J2EE là gì?
N n t ng công ngh chu n và m cho vi c:ề ả ệ ẩ ở ệ
Phát tri n, tri n khai, và qu n lýể ể ả
Các ng d ng l n d a vào các thành ph n, qu n lýứ ụ ớ ự ầ ả
t p trung, d ng web, n t ng.ậ ạ ầ
N n t ng công ngh Javaề ả ệ
High-End
Server
Java Technology
Enabled Desktop
Workgroup
Server
Java Technology
Enabled Devices
N n t ng công ngh Javaề ả ệ
Optional
Packages
Java 2
Enterprise
Edition
(J2EE)
Java 2
Standard
Edition
(J2SE)
JVM
Java
Card
APIs
CardVM
Optional
Packages
Personal
Basis Profile
Personal
Profile
Foundation Profile
CDC
MIDP
CLDC
KVM
Java 2 Platform Micro Edition
(J2METM
)
T i sao s d ng J2EEạ ử ụ
Platform có giá tr cho nhà phát tri n.ị ể
Platform h tr đa d ng công ngh có giáỗ ợ ạ ệ
tr đ i v i ng i s d ng.ị ố ớ ườ ử ụ
Java EE 4 APIs
J2SE 1.4 (improved)
JAX-RPC (new)
Web Service for J2EE
J2EE Management
J2EE Deployment
JMX 1.1
JMS 1.1
JTA 1.0
Servlet 2.4
JSP 2.0
EJB 2.1
JAXR
Connector 1.5
JASS
JAXP 1.2
JavaMail 1.3
JAF 1.0
Java EE 5
JAX-WS 2.0 & JSR 181
Java Persistence
EJB 3.0
JAXB 2.0
JavaSever Faces 1.2 – new to Platform
JSP 2.1 – Unification w/ JSF 1.2
StAX – Pull Parser – new to Platform
Servlet là gì?
Các đ i t ng Java mà nó k th a ch cố ượ ế ừ ứ
năng c a HTTPServerủ
T o n i dung đ ng.ạ ộ ộ
M t s thay th t t CGI, NSAPI, ISAPI, ..ộ ự ế ố
Hi u quệ ả
Đ c l p Platform và server.ộ ậ
Qu n lý Sessionả
D a trên ngôn ng Javaự ữ
Servlet và CGI
CGI
Based
Webserver
Request CGI2
Request CGI1
Request Servlet1
Request Servlet2
Request Servlet1
CGI
Based
Webserver
Child for CGI2
Child for CGI1
Servlet Based Webserver
JVM
Servlet1
Servlet2
Request CGI1
Child for CGI1
JSP là gì?
Cho phép tách bi t x lý nghi p v v i vi cệ ử ệ ụ ớ ệ
trình bày giao di n.ệ
Trình bày d ng HTML ho c XML.ở ạ ặ
X lý nghi p v trình bày d ng Java Bean ho cử ệ ụ ở ạ ặ
custom tag.
Có th duy trì và c i ti n d dàng.ể ả ế ễ
M r ng thông qua custom tag.ở ộ
Xây d ng d a trên công ngh Servlet.ự ự ệ
Công ngh EJB là gì?ệ
Công nghệ ở server-side
Phát tri n và tri n khai ng d ng d a trên côngể ể ứ ụ ự
ngh này d dàng.ệ ễ
Giúp th hi n ti n ích c a công ngh phía serverể ệ ệ ủ ệ
side.
Tách bi t vi c x lý nghi p v v i h th ng code.ệ ệ ử ệ ụ ớ ệ ố
Cho phép c u hình trong th i gian tri n khai.ấ ờ ể
Ki n trúc EJBế
Java Beans
Enterprise JavaBeans
Entity Bean Message-Driven Bean
Synchronous communication Asynchronous communication
Stateless Stateful
Bean managed
Persistence
(BMP)
Container managed
Persistence
(CMP)
Session Bean
Java Message Service (JMS)
Các h th ng thông đi p cung c pệ ố ệ ấ
Các cu c giao ti p d ng c p.ộ ế ạ ặ
Giao ti p đ ng b hóa.ế ồ ộ
Đóng vai trò là b u đi n trung tâm.ư ệ
Ti n l i c a h th ng qu n lý thông đi p.ệ ợ ủ ệ ố ả ệ
Linh ho t, tin c y, g n.ạ ậ ọ
JMS là th vi n chu n cho qu n lý thôngư ệ ẩ ả
đi p.ệ
Ki n trúc Connectorế
Đ nh nghĩa API chu n cho vi c tích h p công nghị ẩ ệ ợ ệ
J2EE v i h th ng EIS.ớ ệ ố
CICS, SAP, PeopleSoft, etc.
Tr c khi có Connector, m i ng d ng server ph iướ ỗ ứ ụ ả
cung c p b đi u khi n thu c tính cho m i EIS.ấ ộ ề ể ộ ỗ
m (# of App servers) x n (# of EIS's) Adaptors
V i ki n trúc connector, cùng m t adaptor có thớ ế ộ ể
th c hi n v i nhi u container J2EE.ự ệ ớ ề
1 (common to all App servers) x n (# of EIS's) Adaptors
Bài toán mxn tr c ki n trúc Connectorướ ế
App
Server1
App
Server
App
Server3
App
Server2
SAP
EIS4
EIS3
m n
EIS2
JAAS: Authentication
G n framework cho vi c ch ng th cắ ệ ứ ự
Userid/password
Smartcard
Kerberos
Biometric
L c đ ch ng th c kh chuy n.ượ ồ ứ ứ ả ể
Cung c p l c đ ch ng th c đ c l p API.ấ ượ ồ ứ ự ộ ậ
L c đ ch ng th c đ c đ c t b i t p tin c uượ ồ ứ ự ượ ặ ả ở ậ ấ
hình mà nó đ c đ c b i JAAS.ượ ọ ở
Ch ng th c - JAASứ ự
JNDI
Giao di n d ch v Naming và Directory.ệ ị ụ
Ti n l i cho ng d ng J2EE xác đ nh tài nguyên vàệ ợ ứ ụ ị
các đ i t ng.ố ượ
ng d ng s d ng tên đ tham chi u đ n tài nguyên quaỨ ụ ử ụ ể ế ế
JNDI.
Tên t ng tr ng và tham chi u đ i t ng ph i đ c c uượ ư ế ố ượ ả ượ ấ
hình b i qu n tr khi ng d ng đ c tri n khai.ở ả ị ứ ụ ượ ể
JDBC
Cung c p th vi n l p trình java cho c sấ ư ệ ậ ơ ỏ
d li u quan h .ữ ệ ệ
S d ng SQLử ụ
Nhà cung c p JDBC driver (đ c g i thôngấ ượ ọ
qua các hàm chu n c a Java).ẩ ủ
Qu n lý J2EEả
M t platform cho phép quan lý J2EEộ
server.
JMX
Tri n khai J2EEể
Tools J2EE Platforms
Standard
Deployment API
(Universal Remote)
IDEs
Vendor Deploy
Tools
Management Tools
JMX
J2EE App Server
App
JMX
JMX
JMX defacto
Dynamic DeploymentJMX API into
the J2EE 1.4 platform
Công nghệ đơn giả cho Platform J2EE
Ki n trúc Plagform J2EEế
B2B
Applications
B2C
Applications
Web
Services
Wireless
Applications
Application Server Enterprise
Information
Systems
Existing
Applications
Ki n trúc N-t ngế ầ
Web Tier EJB Tier
J2EE Containers & ComponentsJNDI
J2SE
JMS
RMI/IIOP
JDBC
Database
App
Client
App Client Container
HTTP/
HTTPS
J2SE
RMI
J2SE
JNDI
JMS
RMI/IIOP
JDBC
JTA
JavaMail
JAF
JNDI
JMS
RMI/IIOP
JDBC
JTA
JavaMail
JAF
HTTP/
HTTPS
Applet Container
Applet JSP Servlet EJB
Web Container EJB Container
RMI
J2SE
Phân tích ng d ng EJBứ ụ
DB & EIS
Resources
Browser
Stand-alone
Web Server EJB Server
Web Server EJB Server
Phân tích ng d ng EJBứ ụ
4-t ngầ
HTML client, JSP/Servlets, EJB, JDBC/Connector
3-t ngầ
HTML client, JSP/Servlets, JDBC
3-t ngầ
EJB standalone applications, EJB, JDBC/Connector
B2B
S d ng JMS ho c thông nghi p d a vào XML.ử ụ ặ ệ ự
Công c thi t l p môi tr ngụ ế ậ ườ
NetBean
IDE
Glassfish
JDK 1.6
IE
Ki n trúc ki m soát s ki nế ể ự ệ
Công ngh ng d ng webệ ứ ụ
Các b c vi t m t ng d ngướ ế ộ ứ ụ
web
Vi t và biên d ch code cho các thành ph n x lýế ị ầ ử
(Servlet or JSP) và các l p b tr khác.ớ ổ ợ
T o các ngu n tài nguyên tĩnh (ví d : nh, HTML)ạ ồ ụ ả
T o t p tin c u hình miêu t tri n khai (web.xml).ạ ậ ấ ả ể
Đóng gói ng d ng Web (t p tin *.war ho c thứ ụ ậ ặ ư
m c đ c deloyment).ụ ượ
Tri n khai ng d ng web vào Web server.ể ứ ụ
Web client truy c p ng d ng URL.ậ ứ ụ
C u trúc th m cấ ư ụ
Th m c g c – l u d ng file *.warư ụ ố ư ạ
build.xml
src: source các thành ph n d ng servlets và JavaBeansầ ạ
web: các trang JSP, trang HTML, các nh.ả
Ví d : hello2ụ
Hello2
• src/servlets
– GreetingServlet.java
– ResponseServlet.java
• web
– WEB-INF
» web.xml
– duke.waving.gif
• build.xml
Tri n khai m t ng d ng webể ộ ứ ụ
S d ng công c h tr deloy c a web server.ử ụ ụ ỗ ợ ủ
Sao chép t p tin *.war vào th m c tri n khai.ậ ư ụ ể
C u trúc t p tin *.war.ấ ậ
URL và Alias
URL
http://[host]:[port]/[request path]?[query string]
URN-Alias
http://localhost:8080/hello1/greeting?username=Monica
C u trúc t p tin XMLấ ậ
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSch
ema-instance"
xsi:schemaLocation="http://java.sun.com/xml
/ns/javaee
http://java.sun.com/xml/ns/javaee/web-
app_2_5.xsd">
<servlet>
<servlet-name>ServletDemo</servlet-name>
<servlet-class>ServletDemo</servlet-class>
<init-param>
<param-name>HelloStr</param-name>
<param-value>Hello Servelet</param-value>
</init-param>
</servlet>
<servlet>
<servlet-name>FormServlet</servlet-name>
<servlet-class>FormServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>UploadServlet</servlet-name>
<servlet-class>UploadServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ServletDemo</servlet-name>
<url-pattern>/ServletDemo</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>FormServlet</servlet-name>
<url-pattern>/FormServlet</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>UploadServlet</servlet-name>
<url-pattern>/UploadServlet</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
Câu h iỏ

More Related Content

What's hot

JSP and Database
JSP and DatabaseJSP and Database
JSP and Database
Nguyễn Anh
 
Bài 6: Custom Tag - Lập Trình Mạng Nâng Cao
Bài 6: Custom Tag - Lập Trình Mạng Nâng CaoBài 6: Custom Tag - Lập Trình Mạng Nâng Cao
Bài 6: Custom Tag - Lập Trình Mạng Nâng Cao
Tuan Nguyen
 
Bài 7,8: Custom Tag - Lập Trình Mạng Nâng Cao
Bài 7,8: Custom Tag - Lập Trình Mạng Nâng CaoBài 7,8: Custom Tag - Lập Trình Mạng Nâng Cao
Bài 7,8: Custom Tag - Lập Trình Mạng Nâng Cao
Tuan Nguyen
 
Bai1 gioi thieu_servlet_va_jsp_8952
Bai1 gioi thieu_servlet_va_jsp_8952Bai1 gioi thieu_servlet_va_jsp_8952
Bai1 gioi thieu_servlet_va_jsp_8952
Ham Chơi
 
Bai4 basic jsp_4474
Bai4 basic jsp_4474Bai4 basic jsp_4474
Bai4 basic jsp_4474
Ham Chơi
 
Introduction to Hibernate Framework
Introduction to Hibernate FrameworkIntroduction to Hibernate Framework
Introduction to Hibernate FrameworkPhuoc Nguyen
 
Bai3 basic servlets_956
Bai3 basic servlets_956Bai3 basic servlets_956
Bai3 basic servlets_956
Ham Chơi
 
Bài 7: Thư viện jQuery và thư viện jQuery UI - Giáo trình FPT
Bài 7: Thư viện jQuery và thư viện jQuery UI - Giáo trình FPTBài 7: Thư viện jQuery và thư viện jQuery UI - Giáo trình FPT
Bài 7: Thư viện jQuery và thư viện jQuery UI - Giáo trình FPT
MasterCode.vn
 
Ebook học Javascript cơ bản tới nâng cao
Ebook học Javascript cơ bản tới nâng caoEbook học Javascript cơ bản tới nâng cao
Ebook học Javascript cơ bản tới nâng cao
Trung Thanh Nguyen
 
DVMS tạo module joomla 2.5
DVMS tạo module joomla 2.5DVMS tạo module joomla 2.5
DVMS tạo module joomla 2.5
dvms
 
Wp hoi-thao-phan-quyen
Wp hoi-thao-phan-quyenWp hoi-thao-phan-quyen
Wp hoi-thao-phan-quyen
KhanhPham
 
Bai2 tong quan_mvc_0567
Bai2 tong quan_mvc_0567Bai2 tong quan_mvc_0567
Bai2 tong quan_mvc_0567
Ham Chơi
 
Tài liệu Zend Framework 2 - Cài đặt và cấu hình Zend Framework 2 - Bài 2
Tài liệu Zend Framework 2 - Cài đặt và cấu hình Zend Framework 2 - Bài 2Tài liệu Zend Framework 2 - Cài đặt và cấu hình Zend Framework 2 - Bài 2
Tài liệu Zend Framework 2 - Cài đặt và cấu hình Zend Framework 2 - Bài 2
KhanhPham
 
Co ban ve_zend_framework 1
Co ban ve_zend_framework 1Co ban ve_zend_framework 1
Co ban ve_zend_framework 1
Ông Thông
 
Mvc4 seminar - hoclaptrinhweb.com - Tài liệu Nhất Nghệ
Mvc4 seminar - hoclaptrinhweb.com - Tài liệu Nhất NghệMvc4 seminar - hoclaptrinhweb.com - Tài liệu Nhất Nghệ
Mvc4 seminar - hoclaptrinhweb.com - Tài liệu Nhất NghệMasterCode.vn
 
Bài 5 Hướng dẫn xây dựng Extension
Bài 5 Hướng dẫn xây dựng ExtensionBài 5 Hướng dẫn xây dựng Extension
Bài 5 Hướng dẫn xây dựng Extension
MasterCode.vn
 
Giao trinh java_script (1)
Giao trinh java_script (1)Giao trinh java_script (1)
Giao trinh java_script (1)duynamit
 
Web203 slide 5
Web203   slide 5Web203   slide 5
Web203 slide 5
tuanduongcntt
 

What's hot (19)

JSP and Database
JSP and DatabaseJSP and Database
JSP and Database
 
Bài 6: Custom Tag - Lập Trình Mạng Nâng Cao
Bài 6: Custom Tag - Lập Trình Mạng Nâng CaoBài 6: Custom Tag - Lập Trình Mạng Nâng Cao
Bài 6: Custom Tag - Lập Trình Mạng Nâng Cao
 
Bài 7,8: Custom Tag - Lập Trình Mạng Nâng Cao
Bài 7,8: Custom Tag - Lập Trình Mạng Nâng CaoBài 7,8: Custom Tag - Lập Trình Mạng Nâng Cao
Bài 7,8: Custom Tag - Lập Trình Mạng Nâng Cao
 
Bai1 gioi thieu_servlet_va_jsp_8952
Bai1 gioi thieu_servlet_va_jsp_8952Bai1 gioi thieu_servlet_va_jsp_8952
Bai1 gioi thieu_servlet_va_jsp_8952
 
Bai4 basic jsp_4474
Bai4 basic jsp_4474Bai4 basic jsp_4474
Bai4 basic jsp_4474
 
Introduction to Hibernate Framework
Introduction to Hibernate FrameworkIntroduction to Hibernate Framework
Introduction to Hibernate Framework
 
Bai3 basic servlets_956
Bai3 basic servlets_956Bai3 basic servlets_956
Bai3 basic servlets_956
 
Bài 7: Thư viện jQuery và thư viện jQuery UI - Giáo trình FPT
Bài 7: Thư viện jQuery và thư viện jQuery UI - Giáo trình FPTBài 7: Thư viện jQuery và thư viện jQuery UI - Giáo trình FPT
Bài 7: Thư viện jQuery và thư viện jQuery UI - Giáo trình FPT
 
Ebook học Javascript cơ bản tới nâng cao
Ebook học Javascript cơ bản tới nâng caoEbook học Javascript cơ bản tới nâng cao
Ebook học Javascript cơ bản tới nâng cao
 
DVMS tạo module joomla 2.5
DVMS tạo module joomla 2.5DVMS tạo module joomla 2.5
DVMS tạo module joomla 2.5
 
Zing osapi v1.3.3
Zing osapi v1.3.3Zing osapi v1.3.3
Zing osapi v1.3.3
 
Wp hoi-thao-phan-quyen
Wp hoi-thao-phan-quyenWp hoi-thao-phan-quyen
Wp hoi-thao-phan-quyen
 
Bai2 tong quan_mvc_0567
Bai2 tong quan_mvc_0567Bai2 tong quan_mvc_0567
Bai2 tong quan_mvc_0567
 
Tài liệu Zend Framework 2 - Cài đặt và cấu hình Zend Framework 2 - Bài 2
Tài liệu Zend Framework 2 - Cài đặt và cấu hình Zend Framework 2 - Bài 2Tài liệu Zend Framework 2 - Cài đặt và cấu hình Zend Framework 2 - Bài 2
Tài liệu Zend Framework 2 - Cài đặt và cấu hình Zend Framework 2 - Bài 2
 
Co ban ve_zend_framework 1
Co ban ve_zend_framework 1Co ban ve_zend_framework 1
Co ban ve_zend_framework 1
 
Mvc4 seminar - hoclaptrinhweb.com - Tài liệu Nhất Nghệ
Mvc4 seminar - hoclaptrinhweb.com - Tài liệu Nhất NghệMvc4 seminar - hoclaptrinhweb.com - Tài liệu Nhất Nghệ
Mvc4 seminar - hoclaptrinhweb.com - Tài liệu Nhất Nghệ
 
Bài 5 Hướng dẫn xây dựng Extension
Bài 5 Hướng dẫn xây dựng ExtensionBài 5 Hướng dẫn xây dựng Extension
Bài 5 Hướng dẫn xây dựng Extension
 
Giao trinh java_script (1)
Giao trinh java_script (1)Giao trinh java_script (1)
Giao trinh java_script (1)
 
Web203 slide 5
Web203   slide 5Web203   slide 5
Web203 slide 5
 

Viewers also liked

Bài 1: Web Cơ Bản - Lập Trình Mạng Nâng Cao
Bài 1: Web Cơ Bản - Lập Trình Mạng Nâng CaoBài 1: Web Cơ Bản - Lập Trình Mạng Nâng Cao
Bài 1: Web Cơ Bản - Lập Trình Mạng Nâng Cao
Tuan Nguyen
 
Hướng dẫn xây dựng ứng dụng web theo mô hình MVC bằng ngôn ngữ Java
Hướng dẫn xây dựng ứng dụng web theo mô hình MVC bằng ngôn ngữ JavaHướng dẫn xây dựng ứng dụng web theo mô hình MVC bằng ngôn ngữ Java
Hướng dẫn xây dựng ứng dụng web theo mô hình MVC bằng ngôn ngữ Java
Huy Vũ
 
Security Bootcamp 2013 - Lap trinh web an toan
Security Bootcamp 2013 - Lap trinh web an toanSecurity Bootcamp 2013 - Lap trinh web an toan
Security Bootcamp 2013 - Lap trinh web an toanSecurity Bootcamp
 
Sức mạnh của jsf 2, phần 3 xử lý sự kiện, java script và ajax
Sức mạnh của jsf 2, phần 3 xử lý sự kiện, java script và ajaxSức mạnh của jsf 2, phần 3 xử lý sự kiện, java script và ajax
Sức mạnh của jsf 2, phần 3 xử lý sự kiện, java script và ajax
Tuyet Tam
 
Bài 12: JSF-2 - Lập Trình Mạng Nâng Cao
Bài 12:  JSF-2 - Lập Trình Mạng Nâng CaoBài 12:  JSF-2 - Lập Trình Mạng Nâng Cao
Bài 12: JSF-2 - Lập Trình Mạng Nâng Cao
Tuan Nguyen
 
[Cntt] bài giảng java khtn hcm
[Cntt] bài giảng java   khtn hcm[Cntt] bài giảng java   khtn hcm
[Cntt] bài giảng java khtn hcm
Hong Phuoc Nguyen
 
Vận dụng kiến thức lập trình web vào môi trường thực tế
Vận dụng kiến thức lập trình web vào môi trường thực tếVận dụng kiến thức lập trình web vào môi trường thực tế
Vận dụng kiến thức lập trình web vào môi trường thực tế
VKhang Yang
 
Mô hình MVC trong lập trình web với Java
Mô hình MVC trong lập trình web với JavaMô hình MVC trong lập trình web với Java
Mô hình MVC trong lập trình web với Java
Huy Vũ
 
VCP 21- VMWare VPC 6
VCP 21- VMWare VPC 6VCP 21- VMWare VPC 6
VCP 21- VMWare VPC 6
Tuan Nguyen
 
Linux LPI Bacis
Linux LPI BacisLinux LPI Bacis
Linux LPI Bacis
Tuan Nguyen
 
Bài 1 Lập trình website theo mô hình MVC - Xây dựng ứng dụng web
Bài 1 Lập trình website theo mô hình MVC - Xây dựng ứng dụng webBài 1 Lập trình website theo mô hình MVC - Xây dựng ứng dụng web
Bài 1 Lập trình website theo mô hình MVC - Xây dựng ứng dụng web
MasterCode.vn
 
BÀI 2 Tổng quan về ILLUSTRATOR CS4 - Giáo trình FPT
BÀI 2 Tổng quan về ILLUSTRATOR CS4 - Giáo trình FPTBÀI 2 Tổng quan về ILLUSTRATOR CS4 - Giáo trình FPT
BÀI 2 Tổng quan về ILLUSTRATOR CS4 - Giáo trình FPT
MasterCode.vn
 
Bài 1: Làm quen với SQL Server 2008 - Giáo trình FPT
Bài 1: Làm quen với SQL Server 2008 - Giáo trình FPTBài 1: Làm quen với SQL Server 2008 - Giáo trình FPT
Bài 1: Làm quen với SQL Server 2008 - Giáo trình FPT
MasterCode.vn
 
tài liệu Mã nguồn mở Lap trình shells
tài liệu Mã nguồn mở  Lap trình shellstài liệu Mã nguồn mở  Lap trình shells
tài liệu Mã nguồn mở Lap trình shells
Thuyet Nguyen
 
Presentation on leadership
Presentation on leadershipPresentation on leadership
Presentation on leadership
sd college
 
Leadership concepts and theories
Leadership concepts and theoriesLeadership concepts and theories
Leadership concepts and theories
alaguraja76
 

Viewers also liked (17)

Bài 1: Web Cơ Bản - Lập Trình Mạng Nâng Cao
Bài 1: Web Cơ Bản - Lập Trình Mạng Nâng CaoBài 1: Web Cơ Bản - Lập Trình Mạng Nâng Cao
Bài 1: Web Cơ Bản - Lập Trình Mạng Nâng Cao
 
Hướng dẫn xây dựng ứng dụng web theo mô hình MVC bằng ngôn ngữ Java
Hướng dẫn xây dựng ứng dụng web theo mô hình MVC bằng ngôn ngữ JavaHướng dẫn xây dựng ứng dụng web theo mô hình MVC bằng ngôn ngữ Java
Hướng dẫn xây dựng ứng dụng web theo mô hình MVC bằng ngôn ngữ Java
 
Security Bootcamp 2013 - Lap trinh web an toan
Security Bootcamp 2013 - Lap trinh web an toanSecurity Bootcamp 2013 - Lap trinh web an toan
Security Bootcamp 2013 - Lap trinh web an toan
 
Sức mạnh của jsf 2, phần 3 xử lý sự kiện, java script và ajax
Sức mạnh của jsf 2, phần 3 xử lý sự kiện, java script và ajaxSức mạnh của jsf 2, phần 3 xử lý sự kiện, java script và ajax
Sức mạnh của jsf 2, phần 3 xử lý sự kiện, java script và ajax
 
Bài 12: JSF-2 - Lập Trình Mạng Nâng Cao
Bài 12:  JSF-2 - Lập Trình Mạng Nâng CaoBài 12:  JSF-2 - Lập Trình Mạng Nâng Cao
Bài 12: JSF-2 - Lập Trình Mạng Nâng Cao
 
[Cntt] bài giảng java khtn hcm
[Cntt] bài giảng java   khtn hcm[Cntt] bài giảng java   khtn hcm
[Cntt] bài giảng java khtn hcm
 
Vận dụng kiến thức lập trình web vào môi trường thực tế
Vận dụng kiến thức lập trình web vào môi trường thực tếVận dụng kiến thức lập trình web vào môi trường thực tế
Vận dụng kiến thức lập trình web vào môi trường thực tế
 
Mô hình MVC trong lập trình web với Java
Mô hình MVC trong lập trình web với JavaMô hình MVC trong lập trình web với Java
Mô hình MVC trong lập trình web với Java
 
VCP 21- VMWare VPC 6
VCP 21- VMWare VPC 6VCP 21- VMWare VPC 6
VCP 21- VMWare VPC 6
 
Linux LPI Bacis
Linux LPI BacisLinux LPI Bacis
Linux LPI Bacis
 
Bài 1 Lập trình website theo mô hình MVC - Xây dựng ứng dụng web
Bài 1 Lập trình website theo mô hình MVC - Xây dựng ứng dụng webBài 1 Lập trình website theo mô hình MVC - Xây dựng ứng dụng web
Bài 1 Lập trình website theo mô hình MVC - Xây dựng ứng dụng web
 
BÀI 2 Tổng quan về ILLUSTRATOR CS4 - Giáo trình FPT
BÀI 2 Tổng quan về ILLUSTRATOR CS4 - Giáo trình FPTBÀI 2 Tổng quan về ILLUSTRATOR CS4 - Giáo trình FPT
BÀI 2 Tổng quan về ILLUSTRATOR CS4 - Giáo trình FPT
 
EJB .
EJB .EJB .
EJB .
 
Bài 1: Làm quen với SQL Server 2008 - Giáo trình FPT
Bài 1: Làm quen với SQL Server 2008 - Giáo trình FPTBài 1: Làm quen với SQL Server 2008 - Giáo trình FPT
Bài 1: Làm quen với SQL Server 2008 - Giáo trình FPT
 
tài liệu Mã nguồn mở Lap trình shells
tài liệu Mã nguồn mở  Lap trình shellstài liệu Mã nguồn mở  Lap trình shells
tài liệu Mã nguồn mở Lap trình shells
 
Presentation on leadership
Presentation on leadershipPresentation on leadership
Presentation on leadership
 
Leadership concepts and theories
Leadership concepts and theoriesLeadership concepts and theories
Leadership concepts and theories
 

Similar to Bài 2: J2EE - Lập Trình Mạng Nâng Cao

Sof301 slide1
Sof301   slide1Sof301   slide1
Sof301 slide1
tonguyencntt
 
ADO .NET Entity framework
ADO .NET Entity frameworkADO .NET Entity framework
ADO .NET Entity framework
Minh Tri Lam
 
Java fx
Java fxJava fx
Android program 6167
Android program 6167Android program 6167
Android program 6167
PhongSPKT
 
CVNguyenThanhLam-102015-Vi
CVNguyenThanhLam-102015-ViCVNguyenThanhLam-102015-Vi
CVNguyenThanhLam-102015-ViLam Nguyen
 
Introduction Vs2008 Dot Net35
Introduction Vs2008 Dot Net35Introduction Vs2008 Dot Net35
Introduction Vs2008 Dot Net35
TechMaster Vietnam
 
Core java 2
Core java 2Core java 2
Core java 2. .
 
Bài thuyết trình môn công nghệ web
Bài thuyết trình môn công nghệ webBài thuyết trình môn công nghệ web
Bài thuyết trình môn công nghệ web
Tony Huynh
 
Gt java080102005
Gt java080102005Gt java080102005
Gt java080102005
Toàn Trần Mạnh
 
Silverlight chapter 1
Silverlight chapter 1Silverlight chapter 1
Silverlight chapter 1
hthuyet
 
Web Architecture
Web ArchitectureWeb Architecture
Web Architecture
Hiep Luong
 
Core java 2
Core java 2Core java 2
Ebook lập trình Java hướng đối tượng (Tiếng việt)
Ebook lập trình Java hướng đối tượng (Tiếng việt)Ebook lập trình Java hướng đối tượng (Tiếng việt)
Ebook lập trình Java hướng đối tượng (Tiếng việt)
Duy Lê Văn
 
Giáo trình java Đại Học Sư Phạm Kỹ Thuật Hưng Yên
Giáo trình java Đại Học Sư Phạm Kỹ Thuật Hưng YênGiáo trình java Đại Học Sư Phạm Kỹ Thuật Hưng Yên
Giáo trình java Đại Học Sư Phạm Kỹ Thuật Hưng YênTrần Thiên Đại
 
Asp net
Asp netAsp net
Asp net
quanvn
 
Tu hoc asp
Tu hoc aspTu hoc asp
Tu hoc asp
hoangnguyentien
 
Tu hoc microsoft asp.net
Tu hoc microsoft asp.netTu hoc microsoft asp.net
Tu hoc microsoft asp.netnamhh1984ag
 

Similar to Bài 2: J2EE - Lập Trình Mạng Nâng Cao (20)

Sof301 slide1
Sof301   slide1Sof301   slide1
Sof301 slide1
 
ADO .NET Entity framework
ADO .NET Entity frameworkADO .NET Entity framework
ADO .NET Entity framework
 
Java fx
Java fxJava fx
Java fx
 
Android program 6167
Android program 6167Android program 6167
Android program 6167
 
CVNguyenThanhLam-102015-Vi
CVNguyenThanhLam-102015-ViCVNguyenThanhLam-102015-Vi
CVNguyenThanhLam-102015-Vi
 
Asp.net 3.5 _1
Asp.net 3.5 _1Asp.net 3.5 _1
Asp.net 3.5 _1
 
Introduction Vs2008 Dot Net35
Introduction Vs2008 Dot Net35Introduction Vs2008 Dot Net35
Introduction Vs2008 Dot Net35
 
Core java 2
Core java 2Core java 2
Core java 2
 
Bài thuyết trình môn công nghệ web
Bài thuyết trình môn công nghệ webBài thuyết trình môn công nghệ web
Bài thuyết trình môn công nghệ web
 
Gt java080102005
Gt java080102005Gt java080102005
Gt java080102005
 
Silverlight chapter 1
Silverlight chapter 1Silverlight chapter 1
Silverlight chapter 1
 
Web Architecture
Web ArchitectureWeb Architecture
Web Architecture
 
Core java 2
Core java 2Core java 2
Core java 2
 
Ebook lập trình Java hướng đối tượng (Tiếng việt)
Ebook lập trình Java hướng đối tượng (Tiếng việt)Ebook lập trình Java hướng đối tượng (Tiếng việt)
Ebook lập trình Java hướng đối tượng (Tiếng việt)
 
Giáo trình java Đại Học Sư Phạm Kỹ Thuật Hưng Yên
Giáo trình java Đại Học Sư Phạm Kỹ Thuật Hưng YênGiáo trình java Đại Học Sư Phạm Kỹ Thuật Hưng Yên
Giáo trình java Đại Học Sư Phạm Kỹ Thuật Hưng Yên
 
Asp net
Asp netAsp net
Asp net
 
Tu hoc asp
Tu hoc aspTu hoc asp
Tu hoc asp
 
Chapter9
Chapter9Chapter9
Chapter9
 
Chapter9
Chapter9Chapter9
Chapter9
 
Tu hoc microsoft asp.net
Tu hoc microsoft asp.netTu hoc microsoft asp.net
Tu hoc microsoft asp.net
 

Bài 2: J2EE - Lập Trình Mạng Nâng Cao

  • 1. T ng quan J2EEổ ThS Văn Thiên Hoàng
  • 2. M c đíchụ Gi i thi u t ng quan v công ngh J2EE.ớ ệ ổ ề ệ Bi t các thành ph n J2EEế ầ
  • 3. J2EE là gì? Challenges Portability Diverse Environments Time-to-market Core Competence Assembly Integration Key Technologies J2SE™ J2EE™ JMS Servlet JSP Connector XML Data Binding XSLT Products App Servers Web Servers Components Databases Object to DB tools Legacy Systems Databases TP Monitors EIS Systems
  • 4. J2EE là gì? N n t ng công ngh chu n và m cho vi c:ề ả ệ ẩ ở ệ Phát tri n, tri n khai, và qu n lýể ể ả Các ng d ng l n d a vào các thành ph n, qu n lýứ ụ ớ ự ầ ả t p trung, d ng web, n t ng.ậ ạ ầ
  • 5. N n t ng công ngh Javaề ả ệ High-End Server Java Technology Enabled Desktop Workgroup Server Java Technology Enabled Devices
  • 6. N n t ng công ngh Javaề ả ệ Optional Packages Java 2 Enterprise Edition (J2EE) Java 2 Standard Edition (J2SE) JVM Java Card APIs CardVM Optional Packages Personal Basis Profile Personal Profile Foundation Profile CDC MIDP CLDC KVM Java 2 Platform Micro Edition (J2METM )
  • 7. T i sao s d ng J2EEạ ử ụ Platform có giá tr cho nhà phát tri n.ị ể Platform h tr đa d ng công ngh có giáỗ ợ ạ ệ tr đ i v i ng i s d ng.ị ố ớ ườ ử ụ
  • 8. Java EE 4 APIs J2SE 1.4 (improved) JAX-RPC (new) Web Service for J2EE J2EE Management J2EE Deployment JMX 1.1 JMS 1.1 JTA 1.0 Servlet 2.4 JSP 2.0 EJB 2.1 JAXR Connector 1.5 JASS JAXP 1.2 JavaMail 1.3 JAF 1.0
  • 9. Java EE 5 JAX-WS 2.0 & JSR 181 Java Persistence EJB 3.0 JAXB 2.0 JavaSever Faces 1.2 – new to Platform JSP 2.1 – Unification w/ JSF 1.2 StAX – Pull Parser – new to Platform
  • 10. Servlet là gì? Các đ i t ng Java mà nó k th a ch cố ượ ế ừ ứ năng c a HTTPServerủ T o n i dung đ ng.ạ ộ ộ M t s thay th t t CGI, NSAPI, ISAPI, ..ộ ự ế ố Hi u quệ ả Đ c l p Platform và server.ộ ậ Qu n lý Sessionả D a trên ngôn ng Javaự ữ
  • 11. Servlet và CGI CGI Based Webserver Request CGI2 Request CGI1 Request Servlet1 Request Servlet2 Request Servlet1 CGI Based Webserver Child for CGI2 Child for CGI1 Servlet Based Webserver JVM Servlet1 Servlet2 Request CGI1 Child for CGI1
  • 12. JSP là gì? Cho phép tách bi t x lý nghi p v v i vi cệ ử ệ ụ ớ ệ trình bày giao di n.ệ Trình bày d ng HTML ho c XML.ở ạ ặ X lý nghi p v trình bày d ng Java Bean ho cử ệ ụ ở ạ ặ custom tag. Có th duy trì và c i ti n d dàng.ể ả ế ễ M r ng thông qua custom tag.ở ộ Xây d ng d a trên công ngh Servlet.ự ự ệ
  • 13. Công ngh EJB là gì?ệ Công nghệ ở server-side Phát tri n và tri n khai ng d ng d a trên côngể ể ứ ụ ự ngh này d dàng.ệ ễ Giúp th hi n ti n ích c a công ngh phía serverể ệ ệ ủ ệ side. Tách bi t vi c x lý nghi p v v i h th ng code.ệ ệ ử ệ ụ ớ ệ ố Cho phép c u hình trong th i gian tri n khai.ấ ờ ể
  • 14. Ki n trúc EJBế
  • 15. Java Beans Enterprise JavaBeans Entity Bean Message-Driven Bean Synchronous communication Asynchronous communication Stateless Stateful Bean managed Persistence (BMP) Container managed Persistence (CMP) Session Bean
  • 16. Java Message Service (JMS) Các h th ng thông đi p cung c pệ ố ệ ấ Các cu c giao ti p d ng c p.ộ ế ạ ặ Giao ti p đ ng b hóa.ế ồ ộ Đóng vai trò là b u đi n trung tâm.ư ệ Ti n l i c a h th ng qu n lý thông đi p.ệ ợ ủ ệ ố ả ệ Linh ho t, tin c y, g n.ạ ậ ọ JMS là th vi n chu n cho qu n lý thôngư ệ ẩ ả đi p.ệ
  • 17. Ki n trúc Connectorế Đ nh nghĩa API chu n cho vi c tích h p công nghị ẩ ệ ợ ệ J2EE v i h th ng EIS.ớ ệ ố CICS, SAP, PeopleSoft, etc. Tr c khi có Connector, m i ng d ng server ph iướ ỗ ứ ụ ả cung c p b đi u khi n thu c tính cho m i EIS.ấ ộ ề ể ộ ỗ m (# of App servers) x n (# of EIS's) Adaptors V i ki n trúc connector, cùng m t adaptor có thớ ế ộ ể th c hi n v i nhi u container J2EE.ự ệ ớ ề 1 (common to all App servers) x n (# of EIS's) Adaptors
  • 18. Bài toán mxn tr c ki n trúc Connectorướ ế App Server1 App Server App Server3 App Server2 SAP EIS4 EIS3 m n EIS2
  • 19. JAAS: Authentication G n framework cho vi c ch ng th cắ ệ ứ ự Userid/password Smartcard Kerberos Biometric L c đ ch ng th c kh chuy n.ượ ồ ứ ứ ả ể Cung c p l c đ ch ng th c đ c l p API.ấ ượ ồ ứ ự ộ ậ L c đ ch ng th c đ c đ c t b i t p tin c uượ ồ ứ ự ượ ặ ả ở ậ ấ hình mà nó đ c đ c b i JAAS.ượ ọ ở
  • 20. Ch ng th c - JAASứ ự
  • 21. JNDI Giao di n d ch v Naming và Directory.ệ ị ụ Ti n l i cho ng d ng J2EE xác đ nh tài nguyên vàệ ợ ứ ụ ị các đ i t ng.ố ượ ng d ng s d ng tên đ tham chi u đ n tài nguyên quaỨ ụ ử ụ ể ế ế JNDI. Tên t ng tr ng và tham chi u đ i t ng ph i đ c c uượ ư ế ố ượ ả ượ ấ hình b i qu n tr khi ng d ng đ c tri n khai.ở ả ị ứ ụ ượ ể
  • 22. JDBC Cung c p th vi n l p trình java cho c sấ ư ệ ậ ơ ỏ d li u quan h .ữ ệ ệ S d ng SQLử ụ Nhà cung c p JDBC driver (đ c g i thôngấ ượ ọ qua các hàm chu n c a Java).ẩ ủ
  • 23. Qu n lý J2EEả M t platform cho phép quan lý J2EEộ server. JMX
  • 24. Tri n khai J2EEể Tools J2EE Platforms Standard Deployment API (Universal Remote) IDEs Vendor Deploy Tools Management Tools
  • 25. JMX J2EE App Server App JMX JMX JMX defacto Dynamic DeploymentJMX API into the J2EE 1.4 platform Công nghệ đơn giả cho Platform J2EE
  • 26. Ki n trúc Plagform J2EEế B2B Applications B2C Applications Web Services Wireless Applications Application Server Enterprise Information Systems Existing Applications
  • 27. Ki n trúc N-t ngế ầ Web Tier EJB Tier
  • 28. J2EE Containers & ComponentsJNDI J2SE JMS RMI/IIOP JDBC Database App Client App Client Container HTTP/ HTTPS J2SE RMI J2SE JNDI JMS RMI/IIOP JDBC JTA JavaMail JAF JNDI JMS RMI/IIOP JDBC JTA JavaMail JAF HTTP/ HTTPS Applet Container Applet JSP Servlet EJB Web Container EJB Container RMI J2SE
  • 29. Phân tích ng d ng EJBứ ụ DB & EIS Resources Browser Stand-alone Web Server EJB Server Web Server EJB Server
  • 30. Phân tích ng d ng EJBứ ụ 4-t ngầ HTML client, JSP/Servlets, EJB, JDBC/Connector 3-t ngầ HTML client, JSP/Servlets, JDBC 3-t ngầ EJB standalone applications, EJB, JDBC/Connector B2B S d ng JMS ho c thông nghi p d a vào XML.ử ụ ặ ệ ự
  • 31. Công c thi t l p môi tr ngụ ế ậ ườ NetBean IDE Glassfish JDK 1.6 IE
  • 32. Ki n trúc ki m soát s ki nế ể ự ệ
  • 33. Công ngh ng d ng webệ ứ ụ
  • 34. Các b c vi t m t ng d ngướ ế ộ ứ ụ web Vi t và biên d ch code cho các thành ph n x lýế ị ầ ử (Servlet or JSP) và các l p b tr khác.ớ ổ ợ T o các ngu n tài nguyên tĩnh (ví d : nh, HTML)ạ ồ ụ ả T o t p tin c u hình miêu t tri n khai (web.xml).ạ ậ ấ ả ể Đóng gói ng d ng Web (t p tin *.war ho c thứ ụ ậ ặ ư m c đ c deloyment).ụ ượ Tri n khai ng d ng web vào Web server.ể ứ ụ Web client truy c p ng d ng URL.ậ ứ ụ
  • 35. C u trúc th m cấ ư ụ Th m c g c – l u d ng file *.warư ụ ố ư ạ build.xml src: source các thành ph n d ng servlets và JavaBeansầ ạ web: các trang JSP, trang HTML, các nh.ả Ví d : hello2ụ Hello2 • src/servlets – GreetingServlet.java – ResponseServlet.java • web – WEB-INF » web.xml – duke.waving.gif • build.xml
  • 36. Tri n khai m t ng d ng webể ộ ứ ụ S d ng công c h tr deloy c a web server.ử ụ ụ ỗ ợ ủ Sao chép t p tin *.war vào th m c tri n khai.ậ ư ụ ể C u trúc t p tin *.war.ấ ậ
  • 37. URL và Alias URL http://[host]:[port]/[request path]?[query string] URN-Alias http://localhost:8080/hello1/greeting?username=Monica
  • 38. C u trúc t p tin XMLấ ậ <?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSch ema-instance" xsi:schemaLocation="http://java.sun.com/xml /ns/javaee http://java.sun.com/xml/ns/javaee/web- app_2_5.xsd"> <servlet> <servlet-name>ServletDemo</servlet-name> <servlet-class>ServletDemo</servlet-class> <init-param> <param-name>HelloStr</param-name> <param-value>Hello Servelet</param-value> </init-param> </servlet> <servlet> <servlet-name>FormServlet</servlet-name> <servlet-class>FormServlet</servlet-class> </servlet> <servlet> <servlet-name>UploadServlet</servlet-name> <servlet-class>UploadServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>ServletDemo</servlet-name> <url-pattern>/ServletDemo</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>FormServlet</servlet-name> <url-pattern>/FormServlet</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>UploadServlet</servlet-name> <url-pattern>/UploadServlet</url-pattern> </servlet-mapping> <session-config> <session-timeout> 30 </session-timeout> </session-config> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> </web-app>

Editor's Notes

  1. What is J2EE? In short, it is an open, standard-based, development and deployment platform for building n-tier, web-based and server-centric, and component-based enterprise applications.
  2. What is Servlet? A servlet is a Java object that extends the functionality of HTTP server by providing the capability of dynamic contents generation. Now you might remember that people used to use CGI for dynamic contents generation. “What is wrong with CGI?” Lots of things. First, inefficiency. In CGI, every HTTP request from client results in a creating of a new process, even if they are from a same client, which is quite inefficient and of course because of that, cannot scale to handle large number of clients at the same time. The servlet technology is designed to solve these problems associated with using CGI, or proprietary APIs such as NSAPI or ISAPI. For example, Servlet handles the HTTP client requests much more efficiently than CGI because it does not have to create new process every time there is a new client request. Instead, it creates a new thread. Because it is Java and because it is standard-based, most of the web servers out there support servlet. It also handles session management for you so that you don’t have to deal with it yourself. By being Java code, it is cross-platform technology as opposed to vendor-specific or product-specific technologies such as NSAPI or ISAPI.
  3. This picture shows difference between CGI and servlet-based model. In CGI, for every HTTP request, a new process has to be created while in servlet model, it is the thread that gets created in the same Java VM (Virtual Machine) and that thread can stay there for serving other requests.
  4. This picture shows a somewhat simplified architecture of EJB. We will talk about the concept of containers and components later on. But a key architectural concept of EJB is that there is a separation of business logic components from the hosting execution environment in which those components are running. The business logic components under EJB architecture are represented as EJB beans while the hosting environment is represented by EJB container (sometimes called as EJB server) . As a business component developer, you have to write three Java files and a deployment descriptor. First you have to write EJB home interface which defines the methods that will be used by clients in order to create and locate your bean through the container. Second, you have to write EJB remote interface which defines the business methods of your bean. Finally, you will build your bean and deployment descriptor which specifies which Java interface is home interface and which Java interface is remote interface, and which class is in fact your bean class. Now container, at the time of deployment of your beans, will create two internal and intermediary objects, EJB home object and EJB remote object. These objects are implementation of home and remote interface you have defined. So when the client wants to invoke some business methods of the EJB bean you created, it is actually talking to these two intermediary objects instead. Why this indirection? This is to allow the container to intercept the calls so that it can provide system services such as security, transaction, persistence, resource management, life cycle management, and so on.
  5. As more businesses move towards an e-business strategy, integration with existing Enterprise Information Systems (EIS) becomes a key to success. Enterprises with successful e-businesses need to integrate their existing EISs with new web-based applications. They need to extend the reach of their EISs to support business-to-business (B2B) transactions. Before the J2EE Connector architecture was defined, no specification for the Java platform addressed the problem of providing a standard architecture for integrating EISs to J2EE application server in a standard-fashion. Most EIS vendors and application server vendors use non-standard vendor-specific adaptors to provide connectivity between application servers and enterprise information systems. The J2EE Connector architecture provides a Java solution to the problem of connectivity between the many application servers and EISs already in existence. By using the J2EE Connector architecture, EIS vendors no longer need to customize their product for each application server. Application server vendors who conform to the J2EE Connector architecture do not need to add custom code whenever they want to add connectivity to a enterprise information system. So it solves the m (appservers) times n (enterprise information systems) adaptor problem. That is with connector architecture, the number of adaptors that need to be developed are the same number of enterprise information systems since a common adaptor can be used for all J2EE compliant application servers.
  6. JAAS addresses both authentication and authorization. So let&apos;s talk about authentication aspect of JAAS first. JAAS provides pluggable authentication framework. It is expected that different business organizations would employ different authentication schemes. Examples of authentication schemes they might use include userid/password based authentication, smartcard, Kerberos, or Biometric authentication. The idea of JAAS pluggable authentication framework is to allow Java application that performs the authentication to be portable regardless of the underlying authentication schemes. So JAAS provides authentication scheme independent API that can be used by the Java application. There is also login configuration file that contains information on the authentication schemes that are deployed for a particular operational environment. And this login configuration file will be read by JAAS runtime.
  7. This picture shows the pluggable authentication framework of JAAS. The application uses the API that is provided by the JAAS runtime implementation. So the boxes of purple color represents the implementation code that is provided by the JAAS. And this code reads the login configuration file during runtime. And each authentication scheme should provide a class file that is compliant to loginModule service provider interface that JAAS architecture defines.
  8. JNDI stands for Java naming and directory interface and it is a common method for locating resources or objects under J2EE framework. JNDI is utilized by J2EE applications to locate resources and objects in a portable fashion. That is, in your application, you are using a symbolic name to refer an object assuming that symbolic name has been configured to real object reference or resource by the system administrator. Because the system administrator can configure the association of the symbolic name and actual object at the time of deployment, the code portability is still assured.