tailieunhanh - UML WEEKEND CRASH COURSE phần 9
Khi máy chủ Web nhận được yêu cầu, nó sẽ tạo ra một phản ứng HTTP, mà là một gói thông tin bao gồm các tài liệu yêu cầu hoặc thông báo lỗi và siêu dữ liệu khác về phản ứng. Các máy chủ Web sẽ tìm kiếm các tập tin đã được quy định trong URL. Trong ví dụ trong hình 27-2, máy chủ Web sẽ tải các tập tin và đặt nội dung của tập tin đó vào các phản ứng HTTP. Các máy chủ Web sau đó sẽ gửi những phản ứng HTTP trên mạng cho. | 280 Sunday Afternoon Figure 27-2 UML Sequence diagram HTTP protocol For example if the URL entered is the Web request will be sent to the Web server on the machine with a domain name of www. . When the Web server receives the request it will create an HTTP response which is a packet of information that includes the requested document or error message and other metadata about the response. The Web server will look for the file that was specified in the URL. In the example in Figure 27-2 the Web server will load the file and place the contents of that file into the HTTP response. The Web server will then send the HTTP response back across the network to the Web browser that made the request. The Web browser will take the HTML out of the HTTP response interpret it and display the content with the specified formatting. Some people may question the choice of objects in the Sequence diagram in Figure 27-2. In truth a Web browser is simply a larger more complex object than a customer or an order. This approach is common practice when modeling interaction between systems that is when modeling the systems as objects . 20 Min. To Go Dynamic Web Content The previous section showed how HTTP is used to send static HTML content to Web browsers. Most Web applications require dynamically generated content. For example when you go to a weather forecast Web site you don t want it to give you the contents of an HTML file that was saved a month ago you want it to generate an up-to-date weather forecast for you on the spot and return it to you. Furthermore you want to be able to access weather information for a certain city. Thus there must be some programming logic that can take your user input and adapt the result to your request. So a weather Web site would Session 27 Introduction to Web Development with Java 281 need to have some programming logic that generated the HTML for the HTTP response. The same is true of
đang nạp các trang xem trước