Danh mục tài liệu

XML, XSLT, Java, and JSP: A Case Study in Developing a Web Application- P5

Số trang: 50      Loại file: pdf      Dung lượng: 1.81 MB      Lượt xem: 11      Lượt tải: 0    
Xem trước 5 trang đầu tiên của tài liệu này:

Thông tin tài liệu:

XML, XSLT, Java, and JSP: A Case Study in Developing a Web Application- P5: Là một nhà phát triển Web, bạn biết những thách thức trong việc xây dựng các ứng dụng mạnh mẽ trên nhiều nền tảng. Tạo các ứng dụng di động trở nên thật sự có thể bằng cách sử dụng Java cho code và XML để tổ chức và quản lý dữ liệu. "XML, XSLT, Java, và JSP: Một trường hợp học" sẽ giúp bạn tối đa hóa khả năng của XML, XSLT, Java, và JSP trong các ứng dụng web của bạn....
Nội dung trích xuất từ tài liệu:
XML, XSLT, Java, and JSP: A Case Study in Developing a Web Application- P5182 Chapter 7 JavaServer Pages: The Browseable User Interface birds with one stone: It would solve the refresh problem and give us material for our chapter about applets, Chapter 9, “Java Applet Plugged In: bonForumRobot.” Because we also wanted to avoid using scripting languages on the client side, we decided not to pursue the experimentation with HTML pragma, buffering pages, and so on. Instead, the robot applet idea was born and provided an alternative, Java-related solution to the problems inherent in frequent refreshes of a page. For all the gory details of how it works, read Chapter 9. We pointed out that the robot applet on the _robot JSP we are discussing gets its parameter values from session attribute values that are set on the top page in the group of pages handling the “host executes chat” phase of the Web application host_exe- cutes_chat.jsp. If we look there again, we will see by the value used to set the document session attribute that this particular applet instance will continually try to display the file named host_executes_chat_frame.jsp. This means that it is going to refresh the display of the chat messages that the host sees.That is something that we would like to do as frequently as possible, allowing for the bandwidth and physical manifestation of such a repeatedly fired Web page.When a guest in the chat adds a message, we want it to show up in the display of all the users as soon as possible. How does the user break out of the frameset that is representing the “host executes chat”Web application phase? We saw before, in host_executes_chat_controls.jsp, that the host can do one of three things: send a message to the chat guests, exit from this chat, or enter command mode. Again, this choice is presented in the code as follows: send this message exit this chat enter command mode One of these Web app destinations, the “host executes command” state, will be dis- cussed only briefly here. If you have followed the discussion so far, you will possess the information needed to understand the following seven interrelated JSP pages that are 7.2 Viewing bonForum from Its JSP Documents 183together involved in offering the chat host some commands to execute.You will havenoticed that we have not provided many commands yet, but we have set up the frame-work and the manner in which more host (and other actor) commands will be addedlater. host_executes_command.jsp host_executes_command_frame.jsp host_executes_command_controls.jsp host_executes_command_ready.jsp host_executes_command_robot.jsp host_increases_rating.jsp host_decreases_rating.jspThe three commands now available for the host to execute do the following: n Increase the status of a guest n Decrease the status of a guest n Change the number of messages displayed to the hostA host can select one guest in the chat from a list of guests displayed by the _frameJSP host_executes_command_frame.jsp. That list is being produced by an XSLT transformation of the information con-tained in the hashtable-based database of the BonForumEngine class. For a relevant dis-cussion, see Section 10.13, “Displaying the Guests in a Chat,” in Chapter 10. The overall idea is that the Web application will automatically remove from a chatany guest whose rating has decreased to 0. Furthermore, the Web application willautomatically change the role of an actor from that of chat guest to that of chat host assoon as the rating of that guest reaches some set value, such as 10 points. The design envisions these multihosted chats, as well as multichat forums and mul-tiforum chat networks. However, the code for these was not considered as high of apriority as those more fleshed-out portions of the Web application. When you are trying out this part of the Web application (you are doing that, aren’tyou?), you should definitely try increasing and decreasing a guest’s rating, changing thenumber of chat messages being displayed, and exercising the navigator buttons in con-junction with smaller lists. (You may even discover that showing the first page of sev-eral is still a bit rough, although it works.) This simple exercise in user feedback in JSPshould make you aware of the possibilities of control mechanisms that can b ...