Web Programming Using a Simple Server ( http://thisisplc.blogspot.com)
Số trang: 19
Loại file: doc
Dung lượng: 170.00 KB
Lượt xem: 2
Lượt tải: 0
Xem trước 2 trang đầu tiên của tài liệu này:
Thông tin tài liệu:
Hypertext Markup Language (HTML) was developed by Tim Berners-Lee in 19921 along with hisinvention of Hypertext Transfer Protocol (HTTP). Together HTML and HTTP created the World WideWeb. Berners-Lee adapted Standard Generalized Markup Language2 (SGML) tags for HTML, carryingover some basic ones. HTML is used by browsers such as Internet Explorer and Firefox to format webpages.
Nội dung trích xuất từ tài liệu:
Web Programming Using a Simple Server ( http://thisisplc.blogspot.com) Web Programming Using a Simple ServerHypertext Markup Language (HTML) was developed by Tim Berners-Lee in 19921 along with hisinvention of Hypertext Transfer Protocol (HTTP). Together HTML and HTTP created the World WideWeb. Berners-Lee adapted Standard Generalized Markup Language2 (SGML) tags for HTML, carryingover some basic ones. HTML is used by browsers such as Internet Explorer and Firefox to format webpages.Many web sites are only used to convey information, however, some also request information from theuser and process that information. The most familiar example is that of e-commerce. Stores provideforms that users fill out with their buying choices and credit card data. Forms are used in many othercontexts as well including logins and registrations.The computer on the web site is called a server and the user’s computer is referred to as the client. Thereare a number of commercial and open-source servers available including ones from Microsoft, SUN, andthe Apache Jakarta Project.3 They all use basic networking protocols. A very simple version of a serverwill be described below. It is helpful to students who wish to learn something about web programmingwithout having to get into the complications involved with a full server.Network Programming using the Java Programming LanguageThe Java language has several classes that are used for network programming. They are in the java.netpackage and are adaptations of the corresponding structures in C. The C structures were introduced in theearly 1980s by researchers in Berkeley while working with the UNIX operating system. The Socket classis used for connecting client computers to a network, and the ServerSocket class is used by servers towait for incoming requests from clients.The SocketImpl class is an abstract class that is the super class of all classes that implement sockets.SocketImpl has four fields, the address of the host computer, the file descriptor, the localport on the clientcomputer, and the port on the host computer to which the client is connected. The host address may besomething like www.cnn.com, the Internet address of the Cable News Network. The port (an integer)could be 80, the standard port for accessing web pages on web servers.The Socket class is a subclass of SocketImpl and is used to create a client connection. The name comesfrom a wall socket that is used to connect an electrical device, such as a lamp, to a source of electricalpower. The connection can be over a local area network (LAN), the Internet, or even using the local loopwithin the computer itself. The local loop has the network address 127.0.0.1. It is often given the name,localhost.41 Dave Raggett , A History of HTML, Chapter 2, Addison Wesley Longman, 1998,http://www.w3.org/People/Raggett/book4/ch02.html.2 SGML was developed in the 1960s and 1970s. It was standardized by the ISL (International Standards Organization)in 1986.3 The Apache Project is located at http://jakarta.apache.org/.4 In Windows 2000 or XP, you can set localhost as an Environment Variable. Go into Settings/ControlPanel/System/Advanced/System Variables. Choose New and then enter localhost as the Variable name and127.0.0.1 as the Variable value. In Windows 98, use Windows Explorer to find Autoexec.bat. It is in the C:\Systemfolder. Edit it and add the line SET localhost=127.0.0.1. When you next boot up your computer, this file will beexecuted and will set the environment variable. 1When a socket is created and opened by a Java program, it uses the Transmission Control Protocol(TCP) /Internet Protocol (IP) or the User Datagram Protocol (UDP). TCP/IP is the principal networkprotocol architecture used on the Internet. UDP is simpler and used when network reliability is not aproblem. TCP is a stream oriented protocol. That means that applications see input and output asstreams of data rather than discrete packets or frames. Therefore programmers can treat network inputand output in the same way as they do keyboard, screen and file I/O.Hypertext Transfer ProtocolThe World Wide Web primarily uses the Hypertext Transfer Protocol (HTTP). HTTP sits on top of TCP/IP and adds functionality needed for web actions such as sending requests, receiving responses andfollowing hyperlinks from one web address to another. It is designed for rapid hops across the Internetand so keeps a connection open for just one transaction.HTTP is said to be stateless. That means that a web server has no memory of its clients. Internetcompanies manage this either by depositing a cookie on the client’s computer or by issuing a sessionidentification number included in the URL string. For example, the following URL string was generatedby the barnesandnoble.com server: http://www.barnesandnoble.com/bookstore.asp?userid=0FJHK58GK6The userid for this specific session is 0FJHK58GK6. It follows the user as he or she moves around theweb site. However, it is dropped when the user clicks on the Back button. Users that use the Back buttonand do not accept cookies may lose the contents of their shopping carts.Web browsers such as Internet Explorer and Firefox are configured for HTTP. When you use one ofthese browsers, it will open a client socket and send a request to the URL (Uniform Resource Locator)address given.When the server sends back a web page, the browser formats it for display on your computer. Theformatting instructions are written in HTML. The World Wide Web Consortium (W3C) publishesrecommendations for browser and web page designers to follow. W3C has issued a number of updatesand is now working on Extensible Hypertext Markup Language (XHTML). XHTML “is a family ofcurrent and future document types and modules that reproduce, subset, and ...
Nội dung trích xuất từ tài liệu:
Web Programming Using a Simple Server ( http://thisisplc.blogspot.com) Web Programming Using a Simple ServerHypertext Markup Language (HTML) was developed by Tim Berners-Lee in 19921 along with hisinvention of Hypertext Transfer Protocol (HTTP). Together HTML and HTTP created the World WideWeb. Berners-Lee adapted Standard Generalized Markup Language2 (SGML) tags for HTML, carryingover some basic ones. HTML is used by browsers such as Internet Explorer and Firefox to format webpages.Many web sites are only used to convey information, however, some also request information from theuser and process that information. The most familiar example is that of e-commerce. Stores provideforms that users fill out with their buying choices and credit card data. Forms are used in many othercontexts as well including logins and registrations.The computer on the web site is called a server and the user’s computer is referred to as the client. Thereare a number of commercial and open-source servers available including ones from Microsoft, SUN, andthe Apache Jakarta Project.3 They all use basic networking protocols. A very simple version of a serverwill be described below. It is helpful to students who wish to learn something about web programmingwithout having to get into the complications involved with a full server.Network Programming using the Java Programming LanguageThe Java language has several classes that are used for network programming. They are in the java.netpackage and are adaptations of the corresponding structures in C. The C structures were introduced in theearly 1980s by researchers in Berkeley while working with the UNIX operating system. The Socket classis used for connecting client computers to a network, and the ServerSocket class is used by servers towait for incoming requests from clients.The SocketImpl class is an abstract class that is the super class of all classes that implement sockets.SocketImpl has four fields, the address of the host computer, the file descriptor, the localport on the clientcomputer, and the port on the host computer to which the client is connected. The host address may besomething like www.cnn.com, the Internet address of the Cable News Network. The port (an integer)could be 80, the standard port for accessing web pages on web servers.The Socket class is a subclass of SocketImpl and is used to create a client connection. The name comesfrom a wall socket that is used to connect an electrical device, such as a lamp, to a source of electricalpower. The connection can be over a local area network (LAN), the Internet, or even using the local loopwithin the computer itself. The local loop has the network address 127.0.0.1. It is often given the name,localhost.41 Dave Raggett , A History of HTML, Chapter 2, Addison Wesley Longman, 1998,http://www.w3.org/People/Raggett/book4/ch02.html.2 SGML was developed in the 1960s and 1970s. It was standardized by the ISL (International Standards Organization)in 1986.3 The Apache Project is located at http://jakarta.apache.org/.4 In Windows 2000 or XP, you can set localhost as an Environment Variable. Go into Settings/ControlPanel/System/Advanced/System Variables. Choose New and then enter localhost as the Variable name and127.0.0.1 as the Variable value. In Windows 98, use Windows Explorer to find Autoexec.bat. It is in the C:\Systemfolder. Edit it and add the line SET localhost=127.0.0.1. When you next boot up your computer, this file will beexecuted and will set the environment variable. 1When a socket is created and opened by a Java program, it uses the Transmission Control Protocol(TCP) /Internet Protocol (IP) or the User Datagram Protocol (UDP). TCP/IP is the principal networkprotocol architecture used on the Internet. UDP is simpler and used when network reliability is not aproblem. TCP is a stream oriented protocol. That means that applications see input and output asstreams of data rather than discrete packets or frames. Therefore programmers can treat network inputand output in the same way as they do keyboard, screen and file I/O.Hypertext Transfer ProtocolThe World Wide Web primarily uses the Hypertext Transfer Protocol (HTTP). HTTP sits on top of TCP/IP and adds functionality needed for web actions such as sending requests, receiving responses andfollowing hyperlinks from one web address to another. It is designed for rapid hops across the Internetand so keeps a connection open for just one transaction.HTTP is said to be stateless. That means that a web server has no memory of its clients. Internetcompanies manage this either by depositing a cookie on the client’s computer or by issuing a sessionidentification number included in the URL string. For example, the following URL string was generatedby the barnesandnoble.com server: http://www.barnesandnoble.com/bookstore.asp?userid=0FJHK58GK6The userid for this specific session is 0FJHK58GK6. It follows the user as he or she moves around theweb site. However, it is dropped when the user clicks on the Back button. Users that use the Back buttonand do not accept cookies may lose the contents of their shopping carts.Web browsers such as Internet Explorer and Firefox are configured for HTTP. When you use one ofthese browsers, it will open a client socket and send a request to the URL (Uniform Resource Locator)address given.When the server sends back a web page, the browser formats it for display on your computer. Theformatting instructions are written in HTML. The World Wide Web Consortium (W3C) publishesrecommendations for browser and web page designers to follow. W3C has issued a number of updatesand is now working on Extensible Hypertext Markup Language (XHTML). XHTML “is a family ofcurrent and future document types and modules that reproduce, subset, and ...
Tìm kiếm theo từ khóa liên quan:
công nghệ thông tin quản trị web tin học Web Programming Using a Simple ServerTài liệu có liên quan:
-
52 trang 467 1 0
-
Top 10 mẹo 'đơn giản nhưng hữu ích' trong nhiếp ảnh
11 trang 367 0 0 -
96 trang 334 0 0
-
74 trang 329 0 0
-
Đồ án tốt nghiệp: Xây dựng ứng dụng di động android quản lý khách hàng cắt tóc
81 trang 319 0 0 -
Tài liệu dạy học môn Tin học trong chương trình đào tạo trình độ cao đẳng
348 trang 319 1 0 -
Báo cáo thực tập thực tế: Nghiên cứu và xây dựng website bằng Wordpress
24 trang 304 0 0 -
Tài liệu hướng dẫn sử dụng thư điện tử tài nguyên và môi trường
72 trang 301 0 0 -
EBay - Internet và câu chuyện thần kỳ: Phần 1
143 trang 296 0 0 -
64 trang 291 0 0