Đang chuẩn bị liên kết để tải về tài liệu:
Professional Java JDK 6 Edition 2007 phần 8

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Sơ đồ trong hình 5-13 minh họa nơi mà biến đổi phù hợp với bức tranh lớn hơn của ứng dụng của bạn.Các phương thức actionPerformed () của lớp WeatherWatcher là nơi mà các dịch vụ Web thời tiết yêu cầu được bắt đầu. Bởi vì WeatherGetter.getWeatherAsync () được gọi, yêu cầu được non-blocking và bắt đầu trong một thread nền. | Chapter 10 EJB 3 and the Java Persistence API if removeitem null removeitem.length 0 for int i 0 i removeitem.length i try System.out.println removing oid name oid removeitem i owners ownersSession.removeOwnersDraftPicks oid removeitem i catch Exception e e.printStackTrace String userSubmit request.getParameter submit if userSubmit null userSubmit.equals Add Draft Pick name.equals try System.out.println adding oid name oid name owners ownersSession.addOwnersDraftPicks oid name catch Exception e e.printStackTrace out.println e.toString List allDraftPicks null try allDraftPicks ownersSession.findAllDraftPicks catch Exception e e.printStackTrace out.println e.toString Checks are used here in the JSP to ensure that the allDraftPicks list is populated with draft pick selections by the owner. If player items are discovered they will be added to the drop-down list display component. Note that both the draft pick name and position are concatenated with a pipe delimiter so both player attributes can be parsed above by the application for visual presentation in the owners list form method post action baseball editOwner.jsp table border 1 if allDraftPicks null allDraftPicks.size 0 tr td colspan 2 No draft picks found. td tr else tr 515 Part II A Broad Understanding of Java APIs Tools and Techniques td select name draftpicks for int i 0 i allDraftPicks.size i DraftPicks draftPicks DraftPicks allDraftPicks.get i option value draftPicks.getName draftPicks.getPosition draftPicks.getName option select td tr tr td colspan 2 align center input type submit name submit value Add Draft Pick input type hidden name oid value oid td tr table form Lastly in this segment of the JSP component the owners draft pick list is rendered along with checkboxes that allow selections to be removed if warranted. The owners draft pick list is obtained from the owner reference procured from the ownersSession.searchForOwners lookup query form method post action baseball editOwner.jsp table tr bgcolor .