HTML?????? - PowerPoint PPT Presentation

About This Presentation
Title:

HTML??????

Description:

Title: HTML Author: NB1 Last modified by: Created Date: 2/8/2001 6:27:07 PM Document presentation format: – PowerPoint PPT presentation

Number of Views:64
Avg rating:3.0/5.0
Slides: 58
Provided by: NB14
Category:
Tags: html | java | servlet

less

Transcript and Presenter's Notes

Title: HTML??????


1
JSP???? ????
????
Fang-Chuan Ou Yang ouyang_at_cyu.edu.tw
2
??
3
?? (1/9)
  • Client / Server
  • Client???????Server????????
  • ???????Client??Server?

Client
Server
request
response
4
?? (2/9)
  • Whats tier ?
  • ??????,Tier??????????????????????????
    (sub-layer)?
  • ????,Tier?????????????,?????????
  • ??????????tiers??interface?middleware?????

5
?? (3/9)
  • Three-tier Client / Server architecture
  • ?Client / Server?,???????????????????? (middle
    tier)?

Presentation tier Server Tier
Database layer
Internet
6
?? (4/9)
  • Three-tier Client / Server architecture (?)
  • Three-tier???????Client Side?????,???thin
    client?
  • Middle tier?????????,??transaction processing
    monitors, message servers application servers

7
?? (5/9)
  • Application Server in Three-tier
  • ???GUI,??????????,??????????
  • ????C/S???????????Client?????????

8
?? (6/9)
  • Whats middleware ?
  • ????(standards)???(protocols)????????????
  • Middleware?????????????????????????????????
  • Middleware ????????
  • Fundamental middleware low-level system, such
    as network operating system (NOS)
  • Applied middleware it usually followed standards
    or specs. such as CORBA, RMI, ODBC
  • User refined middleware based on applied
    middleware to customized a particular system.

9
?? (7/9)
  • Modern C/S Business Application Architecture
  • ???????????????????

Business function
User interface
data
Web HTTP Server Web Application Server CORBA
Server payment server, and so on
10
?? (8/9)
  • Web Server?Http Server??AP Server

Internet
Http server
80
Service
xxxx
Application Server
Service

CGI ASP, ASP.NET PHP JSP
Service
11
?? (9/9)
  • ?????????
  • ??Internet, ??????, ex. WWW, IP, HTTP, etc.
  • ??????/??, ex. ASP, ASP.NET, PHP, JSP
  • ??Application Server????????, ??????????port?,
    ???????/????.
  • ??????/??
  • ????????????, ?????????????.
  • ??????(language)
  • ????(component)/???(API/library)???.
  • ??Web?????? Sessions, Cookies, Applications
  • ?????????????, ?????/???
  • ????

12
?1? JSP??????????
  • 1-1 Web???????
  • 1-2 Java?????
  • 1-3 JSP???????
  • 1-4 JSP???????
  • 1-5 ?IIS??JSP????

13
1-1 Web???????
  • 1-1-1 WWW???
  • 1-1-2 HTTP????
  • 1-1-3 Web????

14
1-1-1 WWW???-??
  • ?WWW?(World Wide Web,??Web)??????1989?????????????
    ?????Internet??,Web?????????????????????????,???Ti
    m Berners Lee???????????????????????

15
1-1-1 WWW???-??
16
1-1-1 WWW???-??
17
1-1-2 HTTP????-??
  • HTTP????(Hypertext Transfer Protocol)???????(Serve
    r)????(Client)???????????,??????1.1?,?????

18
1-1-2 HTTP????-??
  • HTTP????????????????(Client-Server
    Architecture)????,??????URL(Uniform Resource
    Locator)??????????,?????HTTP??(HTTP
    Message)?????,?????????,???????
  • Step 1???????????
  • Step 2????????????
  • Step 3?????HTTP????,??GET???????????????
  • Step 4????HTTP?????????????,??????????????

19
1-1-2 HTTP????-HTTP????
  • GET /path/file.htm HTTP/1.1
  • Host www.host.com
  • Accept image/gif, image/x-xbitmap, image/jpeg,
    image/pjpeg.
  • Accept-Language zh-tw
  • Accept-Encoding gzip, deflate
  • User-Agent Mozilla/4.0(compatible MSIE 6.0
    Windows NT 5.1)
  • Connection Keep-Alive

20
1-1-2 HTTP????-HTTP????
  • HTTP/1.1 200 OK
  • Date Mon, 12 Oct 2004 191216 GMT
  • Server Apache/1.3.12(Unix) Debian/GNU
    mod_perl/1.24
  • Connection Close
  • Content-Type text/html
  • Content-Length 1345
  • lthtmlgt
  • ltbodygt
  • lth1gt..lt/h1gt
  • lt/bodygt
  • lt/htmlgt

21
1-1-3 Web????-??
  • Web????(Web Application)?????????(??HTML??????????
    ??????????)???,??????????????,???????????Internet?
    ????????Web????,?????????????????????????????????
    ????

22
1-1-3 Web????-??
23
1-2 Java?????
  • 1-2-1 Java Applet
  • 1-2-2 Java Servlet
  • 1-2-3 JSP
  • 1-2-4 Java?Web??????

24
1-2-1 Java Applet-??
  • Java Applet????????????,???,???????????Java????,Ja
    va Applet?????java.applet.Applet?????,????
  • import java.applet.Applet
  • import java.awt.Graphics
  • public class Ch1_2_1 extends Applet
  • public void paint(Graphics g)
  • g.drawString("?????Java Applet", 50, 25)

25
1-2-1 Java Applet-????
  • Java Applet??Applet??,????????Java????,???????????
    ??,???????????,??????????Java Applet,????????JVM?
    ??JRE,?????Java Applet,?????

26
1-2-2 Java Servlet-??
  • Java Servlet??Servlet,??????CGI?????,?CGI?(Common
    Gateway Interface)????????Web????????????,Servlet?
    ?????????Web?????,????????JSP???????????,??????2.4
    ?
  • Servlet?Java???????,Java Servlet
    API?Servlet??????????,???javax.servlet?javax.servl
    et.http????,?????????????????HTTP???

27
1-2-2 Java Servlet-??
  • import java.io. import javax.servlet.
  • import javax.servlet.http.
  • public class Ch1_2_2 extends HttpServlet
  • public void doGet(HttpServletRequest request,
  • HttpServletResponse
    response)
  • throws ServletException,
    IOException
  • response.setContentType("text/htmlcharsetB
    ig5")
  • request.setCharacterEncoding("Big5")
  • PrintWriter out response.getWriter()
  • if ( validOrder(request) )
  • saveOrder(request)
  • out.println("lthtmlgt")
  • out.println("lt/bodygtlt/htmlgt")
  • private boolean validOrder(HttpServletRequest
    request)
  • private void saveOrder(HttpServletRequest
    request)

28
1-2-2 Java Servlet-????
  • Servlet?????Web?????Servlet??/???(Servlet
    Container/Engine)???,Servlet????Servlet???Servlet?
    ??????Servlet???,?????

29
1-2-2 Java Servlet-????
30
1-2-3 JSP-??
  • ?JSP?(JavaServer Pages)?????????,??????2.0,???????
    ??,????,????Web??????,???????????,?????????????CG
    I?ASP?ASP.NET?JSP?PHP?
  • JSP?Servlet????????,???????Servlet?????????Web????
    ???????Web?????????????,?JSP??????????????????????
    ?,????,?????Java????Servlet???????????Servlet?????
    ????JSP ?

31
1-2-3 JSP-??
32
1-2-3 JSP-??1
  • ????????????JSP????????????????????HTML??,??,????
    Netscape?Internet Explorer????????????????
  • ????Web????????JSP??????????Windows?Unix?Linux,??
    ?Web???Apache?IIS?,????,?????JSP??,????????????
  • ???????Web????JSP????????Java????,??????????,????
    ?????1-2-4??

33
1-2-3 JSP-??2
  • ?????????????JSP?????????????????????,Web?????HTM
    L/DHTML/XHTML???PDA?WML???XML???
  • ?Servlet????Java????Servlet??????????Java????????
    ,JSP??????????Servlet,??????Servlet???????????,???
    ?????????????JSP???
  • JSTL???ELJSP???JSTL???EL??????HTML???????JSP??,??
    ??????Java??,???????JSP????????????

34
1-2-4 Java?Web??????-??
  • Java?Web?????????Servlet?JSP???JavaBeans???????,??
    ?

35
1-2-4 Java?Web??????- MVC????
  • ?????????????MVC?????(Model-View-Controller
    Design Pattern)???Web???????
  • MVC?????1980??Xerox??????????,?????????View?Contro
    ller?Model ?

36
1-2-4 Java?Web??????-????
  • ???(Presentation Layer)????????????????,?????????
    ???????????????,??????HTML?Java
    Applet?JSP??????????????,???Web?????????,?MVC????(
    Model-View-Control Design Pattern)?View?
  • ???(Control Layer)?????????????????,?Servlet?JSP?
    ??????????????,???????????????Controller,????????H
    TTP???
  • ?????(Business Logic Layer)???????Web????????????
    ,?Model,??????JavaBeans?JSP????????,??????????????
    ???XML???????

37
1-2-4 Java?Web??????- Model 1 Type 1
  • Model 1 Type 1????Web???????,????????JSP??????????
    ?????????????,?????

38
1-2-4 Java?Web??????- Model 1 Type 2
  • Model 1 Type 2?????Web???????,????JSP???????????,J
    avaBeans???????,?????

39
1-2-4 Java?Web??????- Model 2
  • Model 2?????Web???????,??JSP?????View,Servlet?????
    ???????????Controller,JavaBeans???????????????,?Mo
    del,?????

40
1-3 JSP???????
  • 1-3-1 JDK??????
  • 1-3-2 Resin?????????
  • 1-3-3 ?????Resin???
  • 1-3-4 ?????Resin???

41
1-3 JSP???????
  • JSP????????????,????????????????????,?????

42
1-3-1 JDK??????
  • JDK???????????,???????5.0?,??????1.5.0?,???http/
    /java.sun.com/j2se/?
  • ????JDK?,??????JDK????,??Windows
    XP??????Path??????C\Program Files\Java\jdk1.5.0\b
    in?,??C\Program Files\Java\jdk1.5.0\?JDK??????

43
1-3-2 Resin?????????-??1
  • JSP??????JSP?Web????????,??JSP??(JSP
    Container)?????????????????,???Apache?IIS?Web?????
    Servlet/JSP??,????,??Servlet???????JSP??,????
  • Tomcathttp//jakarta.apache.org/tomcat/index.html
    ?
  • JRunhttp//www.macromedia.com?
  • Resinhttp//www.caucho.com?
  • ServletExechttp//www.newatlanta.com?

44
1-3-2 Resin?????????-??2
  • Resin????Caucho Technology???Servlet?JSP??,???????
    ??HTTP 1.1???Web????Servlet/JSP??,?????????Java???
    ??Web????,???????Web???,??IIS,?Web???IIS????????S
    ervlet/JSP???
  • Resin????3.0???Java Servlet 2.4?JSP
    2.0?,??????(Load Balancing)???????,??????Servlet??
    (Servlet Filtering)?????XSL?XML,????????HTML?WAP?X
    ML???

45
1-3-2 Resin?????????-?????
  • ??Resin???
  • Resin????????? 3.0?,???????resin-3.0.9.zip?ZIP????
    ?,?????,????
  • ??Resinhttp//www.caucho.com/download/index.xtp
  • ??Resin???
  • ??Resin???????WinZIP?Windows XP?????????????ZIP???
    ???,???????????????C,?????????C\resin-3.0.9\??

46
1-3-3 ?????Resin???
  • Resin???????????Windows??????????Web???,?????????R
    esin????,?????Resin???,??JSP???????????
  • ???Resin????,???????Internet Explorer?????????????
    ??,????????????????URL??,????
  • http//localhost8080/
  • ??URL???localhost??????,?????8080,?Enter?,????,???
    ???????

47
1-3-4 ?????Resin???
  • ??Resin?Web??????Resin?????Stop???,??????Resin?Web
    ?????,??Quit??,?????Resin????

48
1-4 JSP???????
  • 1-4-1 ???
  • 1-4-2 Gel????????

49
1-4-1 ???
  • Windows?????????????JSP?????,?Windows
    XP??????/????/??????/???????????,?????

50
1-4-2 Gel????????-??
  • Gel???Windows????Delphi???Java/JSP
    IDE,?????Java??,?????????????????????Gel??????,???
    ??????????????????????????????,?????http//www.ge
    xperts.com/download.html?

51
1-4-2 Gel????????-??
52
1-5 ?IIS??JSP????
  • 1-5-1 ??IIS?JSP????
  • 1-5-2 ??Resin??Windows????
  • 1-5-3 ?IIS?????JSP????

53
1-5 ?IIS??JSP????
  • Resin?Serlet/JSP????????IIS?Web???,?IIS?????JSP,??
    JSP???????,????IIS????HTML?????,Resin??JSP?Servlet
    ??,???

54
1-5-1 ??IIS?JSP????
  • Resin??setup??????????IIS?Resin?????,???????
  • Step 1??IIS????Internet??
  • Step 2??IIS?Resin???
  • Step 3??????????????
  • Step 4??Resin?resin.conf??
  • Step 5??IIS?JSP????

55
1-5-2 ??Resin??Windows????
  • IIS???JSP?????????Resin???,?????Resin???????Window
    s????,???Windows?????,?????Resin?
  • ???????????,????????Resin??????,????
  • C\gtresin-3.0.9\httpd -install Enter

56
1-5-3 ?IIS?????JSP????-1
  • ???????????????JSP????,???IISResin???????JSP??,??
    ???????
  • Step 1?IIS??JSP?????
  • Step 2???????wwwroot??????????????C/inetpub/wwwr
    oot?????

57
1-5-3 ?IIS?????JSP????-2
  • Step 3??????Ch01??????resin.conf??????C\resin-3.
    0.9\conf????,?resin.conf???????????Web????,????
  • ltweb-app id'/Ch04' document-directory'c/inetpub
    /wwwroot/ch04'/gt
  • .
  • ltweb-app id'/Ch14' document-directory'c/inetpub
    /wwwroot/ch14'/gt
  • ltweb-app id'/Ch15' document-directory'c/inetpub
    /wwwroot/ch15'/gt
  • Step 4????Resin??????Web??????????
Write a Comment
User Comments (0)
About PowerShow.com