際際滷

際際滷Share a Scribd company logo
Ph畉m 畛c 畛
ducde1606@gmail.com
Copyright 2018
T畛ng quan Java EE
1https://www.facebook.com/jtcpage
N畛i dung
 Gi畛i thi畛u Java EE
 M畛t s畛 kh叩i ni畛m li棚n quan 畛ng d畛ng Java EE
 Ph叩t tri畛n 畛ng d畛ng 畉u ti棚n
2https://www.facebook.com/jtcpage
N畛i dung
 Gi畛i thi畛u Java EE
 M畛t s畛 kh叩i ni畛m li棚n quan 畛ng d畛ng Java EE
 Ph叩t tri畛n 畛ng d畛ng 畉u ti棚n
3https://www.facebook.com/jtcpage
Java EE platform l g狸?
 Java EE hay JEE (Java Enterprise Editor)
 L c担ng ngh畛 h畛 tr畛 ph叩t tri畛n 畛ng d畛ng web
 Java EE cung c畉p API cho vi畛c ph叩t tri畛n 畛ng d畛ng nh畉m:
 Gi畉m th畛i gian ph叩t tri畛n 畛ng d畛ng
 Gi畉m 畛 ph畛c t畉p c畛a 畛ng d畛ng
 Tng hi畛u su畉t 畛ng d畛ng
 Phi棚n b畉n Java EE
 Java EE 7 (12/06/2013)
 Java EE 8 (31/08/2017)
4https://www.facebook.com/jtcpage
M担 h狸nh 畛ng d畛ng Java EE
 畛nh ngh挑a m畛t ki畉n tr炭c hi畛n th畛c c叩c d畛ch v畛 nh動 l 畛ng d畛ng
a t畉ng (multi  tier) c坦 動u i畛m:
 Kh畉 nng m畛 r畛ng (Scalability)
 Kh畉 nng truy c畉p (Accessibility)
 Kh畉 nng qu畉n l箪 (Manageability)
 M担 h狸nh ki畉n tr炭c chia lm 2 t畉ng
 T畉ng tr狸nh di畛n (presentation tier)
 T畉ng nghi畛p v畛 (business tier)
5https://www.facebook.com/jtcpage
M担 h狸nh 畛ng d畛ng Java EE
6https://www.facebook.com/jtcpage
Giao ti畉p gi畛a client-server
7https://www.facebook.com/jtcpage
Java EE container
8https://www.facebook.com/jtcpage
C叩c d畛ch v畛 trong Container
 Java EE cung c畉p h畛 th畛ng c叩c d畛ch v畛 cho vi畛c ph叩t tri畛n 畛ng
d畛ng web-based:
 D畛ch v畛 b畉o m畉t (security service)
 D畛ch v畛 giao d畛ch (transaction service)
 D畛ch v畛 JNDI (JNDI lookup service)
 
 S畛 d畛ng c叩c d畛ch v畛 c坦 s畉n gi炭p cho vi畛c ph叩t tri畛n 畛ng d畛ng
動畛c nhanh ch坦ng v t畛i 動u h董n
9https://www.facebook.com/jtcpage
Java EE API
10https://www.facebook.com/jtcpage
N畛i dung
 Gi畛i thi畛u Java EE
 M畛t s畛 kh叩i ni畛m li棚n quan 畛ng d畛ng Java EE
 Ph叩t tri畛n 畛ng d畛ng 畉u ti棚n
11https://www.facebook.com/jtcpage
Kh叩i ni畛m network
 L m畛t t畉p h畛p c叩c m叩y t鱈nh v c叩c thi畉t b畛 kh叩c m c坦 th畛 g畛i
v nh畉n d畛 li畛u t畛 n董i ny qua n董i kh叩c th担ng qua c叩c ph動董ng
ti畛n v畉t l箪
12https://www.facebook.com/jtcpage
畛a ch畛 IP
 L m畛t 畛a ch畛 duy nh畉t m thi畉t b畛 i畛n t畛 hi畛n ang s畛 d畛ng
v 動畛c d湛ng 畛 x叩c 畛nh thi畉t b畛 trong m担i tr動畛ng m畉ng
 Ph但n lo畉i
 IPv4: 32bit
 IPv6: 128bit
13https://www.facebook.com/jtcpage
Port
 Port l m畛t s畛 畉c bi畛t hi畛n di畛n trong ti棚u 畛 c畛a m畛t g坦i d畛
li畛u
 Port th動畛ng 動畛c s畛 d畛ng 畛 叩nh x畉 d畛 li畛u cho m畛t qu叩 tr狸nh
c畛 th畛 ang ch畉y tr棚n m畛t m叩y t鱈nh
14https://www.facebook.com/jtcpage
Giao th畛c (protocol)
 L m畛t quy 動畛c
ho畉c ti棚u chu畉n
畛 ki畛m so叩t
ho畉c k畉t n畛i,
giao ti畉p v
truy畛n d畛 li畛u
gi畛a hai thi畉t b畛
m叩y t鱈nh 畉u
cu畛i
15https://www.facebook.com/jtcpage
HTTP
 Hyper Text Transfer Protocol (giao th畛c truy畛n t畉i si棚u vn b畉n)
 L giao th畛c chu畉n giao ti畉p gi畛a client-server tr棚n www (world
wide web)
 Port m畉c 畛nh 80
 Phi棚n b畉n:
 1.x (1.0, 1.1, 1.2, 1.3)
 Hi畛n t畉i HTTP/2 (2.0 vo th叩ng 5/2015 )
16https://www.facebook.com/jtcpage
HTTPs
 M畛 r畛ng giao th畛c HTTP cho vi畛c
giao ti畉p b畉o m畉t:
 SSL (Secure Socket Layer)
 Ho畉c TLS (Transport Layer Security)
 Port m畉c 畛nh l 443
17https://www.facebook.com/jtcpage
HTTP(s)
 Ph動董ng th畛c
 GET, HEAD, POST, PUT, ...
 Status code
 1xx Informational: 101 Switching Protocols
 2xx Success: 200 OK
 3xx Redirection: 305 Use Proxy
 4xx Client Error: 404 File Not Found
 5xx Server Error: 500 Internal Error
18https://www.facebook.com/jtcpage
DNS  Domain Name System
 nh x畉 t棚n m叩y sang 畛a ch畛 IP
DNS name space
19https://www.facebook.com/jtcpage
URI, URN v URL
 Uniform Resource Identifier (URI) l m畛t chu畛i
k箪 t畛 畛 x叩c 畛nh t棚n ho畉c m畛t ti nguy棚n
 URI c坦 th畛 動畛c ph但n lo畉i nh動 nh畉n d畉ng:
 B畛 畛nh v畛 - URL (Uniform Resource Locator)
 Ho畉c b畛 畛nh danh  URN (Uniform Resource
Name)
 Ho畉c c畉 hai
https://en.wikipedia.org/wiki/Uniform_Resource_Identifier
urn:isbn:0132350882
20https://www.facebook.com/jtcpage
N畛i dung
 Gi畛i thi畛u Java EE
 M畛t s畛 kh叩i ni畛m li棚n quan 畛ng d畛ng Java EE
 Ph叩t tri畛n 畛ng d畛ng 畉u ti棚n
21https://www.facebook.com/jtcpage
Ci 畉t m担i tr動畛ng
 Java SDK (J2SE)
 Ph畉n m畛m so畉n th畉o
 Notepad
 Eclipse IDE
 Netbean IDE
 
 Application server (Web server)
 Apache tomcat
 Jboss server
 
22https://www.facebook.com/jtcpage
Ci 畉t v c畉u h狸nh Apache Tomcat
 B畉n m畛i nh畉t t畉i
 Download b畉n zip (ho畉c tar.gz)
trong m畛c core
 Ci 畉t:
 Gi畉i n辿n vo th動 m畛c (kh担ng
c畉n ph畉i ci 畉t)
23
https://tomcat.apache.org/download-90.cgi
https://www.facebook.com/jtcpage
Ch畉y 畛ng d畛ng Apache Tomcat
 Trong m担i tr動畛ng Server (mn h狸nh Command line):
 Ci 畉t bi畉n m担i tr動畛ng
 JAVA_HOME
 CATALINA_HOME
 G探 l畛nh trong th動 m畛c bin:
 startup.bat/ startup.sh
 shutdown.bat/ shutdown.sh
24https://www.facebook.com/jtcpage
Ch畉y 畛ng d畛ng Apache Tomcat
 Trong m担i tr動畛ng
developer (t鱈ch h畛p vo
IDE)
 Ci 畉t Apache Tomcat vo
Eclipse
 Th畛c hi畛n l畛nh start/ stop
tr棚n IDE
25https://www.facebook.com/jtcpage
26
T畉i m叩y local:
http://localhost:8080
http://127.0.0.1:8080
T畉i m叩y remote:
http://IP:8080
V畛i IP l 畛a ch畛 c畛a
m叩y ch畉y Apache
Tomcat
Ch畉y 畛ng d畛ng Apache Tomcat
https://www.facebook.com/jtcpage
畛ng d畛ng web-based
 Client-side
 Html, Javascript, css
 VBScript
 Applet
 Server-side
 CGI  Common Gateway Interface
 Servlet/JSP
 ASP.Net
 PHP
27https://www.facebook.com/jtcpage
HTML
 HTML (Hyper Text Markup Language - Ng担n ng畛 叩nh d畉u si棚u
vn b畉n) l m畛t s畛 畛nh d畉ng 畛 b叩o cho tr狸nh duy畛t Web (Web
browser) bi畉t c叩ch 畛 hi畛n th畛 m畛t trang Web.
 C叩c trang Web l vn b畉n c湛ng v畛i c叩c th畉 (tag) HTML 動畛c
s畉p x畉p 炭ng c叩ch ho畉c c叩c o畉n m達 畛 tr狸nh duy畛t Web bi畉t
c叩ch 畛 th担ng d畛ch v hi畛n th畛 ch炭ng l棚n tr棚n mn h狸nh
28https://www.facebook.com/jtcpage
C畉u tr炭c HTML page
 <!Doctype>
 Ph畉n khai b叩o chu畉n c畛a html hay xhtml.
 <head></head>
 Ph畉n khai b叩o ban 畉u, khai b叩o v畛 meta, title, css, javascript
 <body></body>
 Ph畉n ch畛a n畛i dung c畛a trang web, n董i hi畛n th畛 n畛i dung
 Ch炭 th鱈ch s畛 d畛ng <!-- v -->.
29https://www.facebook.com/jtcpage
CSS
 Styles 畛nh ngh挑a c叩ch c叩c thnh ph畉n HTML hi畛n th畛 nh動 th畉
no.
 C叩c Styles th担ng th動畛ng 動畛c l動u tr畛 trong m畛t Style Sheets
30https://www.facebook.com/jtcpage
CSS
 C坦 ba c叩ch ch竪n Style:
 External Style Sheets
 Internal Style Sheets
 Inline Style
 External Style Sheets 動畛c l動u trong nh畛ng t畛p c坦 ph畉n m畛
r畛ng l CSS.
 Ho畉t 畛ng d畛a tr棚n b畛 ch畛n (selectors) & thu畛c t鱈nh
31https://www.facebook.com/jtcpage
JavaScript
 L ng担n ng畛 th担ng d畛ch
 ch動董ng tr狸nh ngu畛n c畛a n坦 動畛c nh炭ng ho畉c t鱈ch h畛p vo t畉p tin
HTML
 Khi trang web 動畛c t畉i trong tr狸nh duy畛t h畛 tr畛 javascript
 Tr狸nh duy畛t s畉 th担ng d畛ch v th畛c hi畛n c叩c l畛nh Javascipt.
32https://www.facebook.com/jtcpage
JavaScript
 Ch動董ng tr狸nh ngu畛n Javascript 動畛c th担ng d畛ch trong trang
HTML
 Sau khi ton b畛 trang 動畛c load
 Nh動ng tr動畛c khi trang 動畛c hi畛n th畛
 C坦 2 c叩ch 畛 nh炭ng Javascript vo trong t畉p tin HTML
 Tr畛c ti畉p trong file HTML
 S畛 d畛ng t畉p tin javascript b棚n ngoi
33https://www.facebook.com/jtcpage
34
K畉T CH働NG
https://www.facebook.com/jtcpage

More Related Content

JavaEE Basic_Chapter1: Introduce JavaEE

  • 1. Ph畉m 畛c 畛 ducde1606@gmail.com Copyright 2018 T畛ng quan Java EE 1https://www.facebook.com/jtcpage
  • 2. N畛i dung Gi畛i thi畛u Java EE M畛t s畛 kh叩i ni畛m li棚n quan 畛ng d畛ng Java EE Ph叩t tri畛n 畛ng d畛ng 畉u ti棚n 2https://www.facebook.com/jtcpage
  • 3. N畛i dung Gi畛i thi畛u Java EE M畛t s畛 kh叩i ni畛m li棚n quan 畛ng d畛ng Java EE Ph叩t tri畛n 畛ng d畛ng 畉u ti棚n 3https://www.facebook.com/jtcpage
  • 4. Java EE platform l g狸? Java EE hay JEE (Java Enterprise Editor) L c担ng ngh畛 h畛 tr畛 ph叩t tri畛n 畛ng d畛ng web Java EE cung c畉p API cho vi畛c ph叩t tri畛n 畛ng d畛ng nh畉m: Gi畉m th畛i gian ph叩t tri畛n 畛ng d畛ng Gi畉m 畛 ph畛c t畉p c畛a 畛ng d畛ng Tng hi畛u su畉t 畛ng d畛ng Phi棚n b畉n Java EE Java EE 7 (12/06/2013) Java EE 8 (31/08/2017) 4https://www.facebook.com/jtcpage
  • 5. M担 h狸nh 畛ng d畛ng Java EE 畛nh ngh挑a m畛t ki畉n tr炭c hi畛n th畛c c叩c d畛ch v畛 nh動 l 畛ng d畛ng a t畉ng (multi tier) c坦 動u i畛m: Kh畉 nng m畛 r畛ng (Scalability) Kh畉 nng truy c畉p (Accessibility) Kh畉 nng qu畉n l箪 (Manageability) M担 h狸nh ki畉n tr炭c chia lm 2 t畉ng T畉ng tr狸nh di畛n (presentation tier) T畉ng nghi畛p v畛 (business tier) 5https://www.facebook.com/jtcpage
  • 6. M担 h狸nh 畛ng d畛ng Java EE 6https://www.facebook.com/jtcpage
  • 7. Giao ti畉p gi畛a client-server 7https://www.facebook.com/jtcpage
  • 9. C叩c d畛ch v畛 trong Container Java EE cung c畉p h畛 th畛ng c叩c d畛ch v畛 cho vi畛c ph叩t tri畛n 畛ng d畛ng web-based: D畛ch v畛 b畉o m畉t (security service) D畛ch v畛 giao d畛ch (transaction service) D畛ch v畛 JNDI (JNDI lookup service) S畛 d畛ng c叩c d畛ch v畛 c坦 s畉n gi炭p cho vi畛c ph叩t tri畛n 畛ng d畛ng 動畛c nhanh ch坦ng v t畛i 動u h董n 9https://www.facebook.com/jtcpage
  • 11. N畛i dung Gi畛i thi畛u Java EE M畛t s畛 kh叩i ni畛m li棚n quan 畛ng d畛ng Java EE Ph叩t tri畛n 畛ng d畛ng 畉u ti棚n 11https://www.facebook.com/jtcpage
  • 12. Kh叩i ni畛m network L m畛t t畉p h畛p c叩c m叩y t鱈nh v c叩c thi畉t b畛 kh叩c m c坦 th畛 g畛i v nh畉n d畛 li畛u t畛 n董i ny qua n董i kh叩c th担ng qua c叩c ph動董ng ti畛n v畉t l箪 12https://www.facebook.com/jtcpage
  • 13. 畛a ch畛 IP L m畛t 畛a ch畛 duy nh畉t m thi畉t b畛 i畛n t畛 hi畛n ang s畛 d畛ng v 動畛c d湛ng 畛 x叩c 畛nh thi畉t b畛 trong m担i tr動畛ng m畉ng Ph但n lo畉i IPv4: 32bit IPv6: 128bit 13https://www.facebook.com/jtcpage
  • 14. Port Port l m畛t s畛 畉c bi畛t hi畛n di畛n trong ti棚u 畛 c畛a m畛t g坦i d畛 li畛u Port th動畛ng 動畛c s畛 d畛ng 畛 叩nh x畉 d畛 li畛u cho m畛t qu叩 tr狸nh c畛 th畛 ang ch畉y tr棚n m畛t m叩y t鱈nh 14https://www.facebook.com/jtcpage
  • 15. Giao th畛c (protocol) L m畛t quy 動畛c ho畉c ti棚u chu畉n 畛 ki畛m so叩t ho畉c k畉t n畛i, giao ti畉p v truy畛n d畛 li畛u gi畛a hai thi畉t b畛 m叩y t鱈nh 畉u cu畛i 15https://www.facebook.com/jtcpage
  • 16. HTTP Hyper Text Transfer Protocol (giao th畛c truy畛n t畉i si棚u vn b畉n) L giao th畛c chu畉n giao ti畉p gi畛a client-server tr棚n www (world wide web) Port m畉c 畛nh 80 Phi棚n b畉n: 1.x (1.0, 1.1, 1.2, 1.3) Hi畛n t畉i HTTP/2 (2.0 vo th叩ng 5/2015 ) 16https://www.facebook.com/jtcpage
  • 17. HTTPs M畛 r畛ng giao th畛c HTTP cho vi畛c giao ti畉p b畉o m畉t: SSL (Secure Socket Layer) Ho畉c TLS (Transport Layer Security) Port m畉c 畛nh l 443 17https://www.facebook.com/jtcpage
  • 18. HTTP(s) Ph動董ng th畛c GET, HEAD, POST, PUT, ... Status code 1xx Informational: 101 Switching Protocols 2xx Success: 200 OK 3xx Redirection: 305 Use Proxy 4xx Client Error: 404 File Not Found 5xx Server Error: 500 Internal Error 18https://www.facebook.com/jtcpage
  • 19. DNS Domain Name System nh x畉 t棚n m叩y sang 畛a ch畛 IP DNS name space 19https://www.facebook.com/jtcpage
  • 20. URI, URN v URL Uniform Resource Identifier (URI) l m畛t chu畛i k箪 t畛 畛 x叩c 畛nh t棚n ho畉c m畛t ti nguy棚n URI c坦 th畛 動畛c ph但n lo畉i nh動 nh畉n d畉ng: B畛 畛nh v畛 - URL (Uniform Resource Locator) Ho畉c b畛 畛nh danh URN (Uniform Resource Name) Ho畉c c畉 hai https://en.wikipedia.org/wiki/Uniform_Resource_Identifier urn:isbn:0132350882 20https://www.facebook.com/jtcpage
  • 21. N畛i dung Gi畛i thi畛u Java EE M畛t s畛 kh叩i ni畛m li棚n quan 畛ng d畛ng Java EE Ph叩t tri畛n 畛ng d畛ng 畉u ti棚n 21https://www.facebook.com/jtcpage
  • 22. Ci 畉t m担i tr動畛ng Java SDK (J2SE) Ph畉n m畛m so畉n th畉o Notepad Eclipse IDE Netbean IDE Application server (Web server) Apache tomcat Jboss server 22https://www.facebook.com/jtcpage
  • 23. Ci 畉t v c畉u h狸nh Apache Tomcat B畉n m畛i nh畉t t畉i Download b畉n zip (ho畉c tar.gz) trong m畛c core Ci 畉t: Gi畉i n辿n vo th動 m畛c (kh担ng c畉n ph畉i ci 畉t) 23 https://tomcat.apache.org/download-90.cgi https://www.facebook.com/jtcpage
  • 24. Ch畉y 畛ng d畛ng Apache Tomcat Trong m担i tr動畛ng Server (mn h狸nh Command line): Ci 畉t bi畉n m担i tr動畛ng JAVA_HOME CATALINA_HOME G探 l畛nh trong th動 m畛c bin: startup.bat/ startup.sh shutdown.bat/ shutdown.sh 24https://www.facebook.com/jtcpage
  • 25. Ch畉y 畛ng d畛ng Apache Tomcat Trong m担i tr動畛ng developer (t鱈ch h畛p vo IDE) Ci 畉t Apache Tomcat vo Eclipse Th畛c hi畛n l畛nh start/ stop tr棚n IDE 25https://www.facebook.com/jtcpage
  • 26. 26 T畉i m叩y local: http://localhost:8080 http://127.0.0.1:8080 T畉i m叩y remote: http://IP:8080 V畛i IP l 畛a ch畛 c畛a m叩y ch畉y Apache Tomcat Ch畉y 畛ng d畛ng Apache Tomcat https://www.facebook.com/jtcpage
  • 27. 畛ng d畛ng web-based Client-side Html, Javascript, css VBScript Applet Server-side CGI Common Gateway Interface Servlet/JSP ASP.Net PHP 27https://www.facebook.com/jtcpage
  • 28. HTML HTML (Hyper Text Markup Language - Ng担n ng畛 叩nh d畉u si棚u vn b畉n) l m畛t s畛 畛nh d畉ng 畛 b叩o cho tr狸nh duy畛t Web (Web browser) bi畉t c叩ch 畛 hi畛n th畛 m畛t trang Web. C叩c trang Web l vn b畉n c湛ng v畛i c叩c th畉 (tag) HTML 動畛c s畉p x畉p 炭ng c叩ch ho畉c c叩c o畉n m達 畛 tr狸nh duy畛t Web bi畉t c叩ch 畛 th担ng d畛ch v hi畛n th畛 ch炭ng l棚n tr棚n mn h狸nh 28https://www.facebook.com/jtcpage
  • 29. C畉u tr炭c HTML page <!Doctype> Ph畉n khai b叩o chu畉n c畛a html hay xhtml. <head></head> Ph畉n khai b叩o ban 畉u, khai b叩o v畛 meta, title, css, javascript <body></body> Ph畉n ch畛a n畛i dung c畛a trang web, n董i hi畛n th畛 n畛i dung Ch炭 th鱈ch s畛 d畛ng <!-- v -->. 29https://www.facebook.com/jtcpage
  • 30. CSS Styles 畛nh ngh挑a c叩ch c叩c thnh ph畉n HTML hi畛n th畛 nh動 th畉 no. C叩c Styles th担ng th動畛ng 動畛c l動u tr畛 trong m畛t Style Sheets 30https://www.facebook.com/jtcpage
  • 31. CSS C坦 ba c叩ch ch竪n Style: External Style Sheets Internal Style Sheets Inline Style External Style Sheets 動畛c l動u trong nh畛ng t畛p c坦 ph畉n m畛 r畛ng l CSS. Ho畉t 畛ng d畛a tr棚n b畛 ch畛n (selectors) & thu畛c t鱈nh 31https://www.facebook.com/jtcpage
  • 32. JavaScript L ng担n ng畛 th担ng d畛ch ch動董ng tr狸nh ngu畛n c畛a n坦 動畛c nh炭ng ho畉c t鱈ch h畛p vo t畉p tin HTML Khi trang web 動畛c t畉i trong tr狸nh duy畛t h畛 tr畛 javascript Tr狸nh duy畛t s畉 th担ng d畛ch v th畛c hi畛n c叩c l畛nh Javascipt. 32https://www.facebook.com/jtcpage
  • 33. JavaScript Ch動董ng tr狸nh ngu畛n Javascript 動畛c th担ng d畛ch trong trang HTML Sau khi ton b畛 trang 動畛c load Nh動ng tr動畛c khi trang 動畛c hi畛n th畛 C坦 2 c叩ch 畛 nh炭ng Javascript vo trong t畉p tin HTML Tr畛c ti畉p trong file HTML S畛 d畛ng t畉p tin javascript b棚n ngoi 33https://www.facebook.com/jtcpage