TAILIEUCHUNG - Practical Apache Struts2 Web 2.0 Projects retail phần 8

bên dưới mỗi khác, hơn là theo chiều ngang bên cạnh nhau thay vì tạo ra các mẫu cá nhân, chúng tôi sẽ tạo ra một chủ đề mà cho phép bạn mở rộng khi hai trường hợp này là dự án phát 6-4. Sự kiện Thông tin chi tiết Enter trang hiển thị các kết quả của thất bại tùy chỉnh trình xác nhận | 232 CHAPTER 8 SEARCHING AND LISTINGS s iterator status rowstatus value s property value name s if test false s if s iterator li ul p Figure 8-8. The advanced search results using a new template theme Consolidating List Actions The final consideration for the search use cases is whether the code can be optimized or consolidated. From the very beginning the template was developed with reusability in mind. Because there were several search uses cases and each needed to display results a common results page was developed. To provide the generic canvas that any CHAPTER 8 SEARCHING AND LISTINGS 233 action could use the template used properties from the calling action to provide context information to the user. The downside of this approach is that each and every calling action is now required to provide these properties. When the search actions were being developed the commonality required to render the result was missed and it s now time to return and extract the common elements. The first step is to create a base class and extract the common elements. Each of these elements has been covered in detail previously The property and setter that allows the Eventservice business service to be used by the action The property and getter for the list of resulting events The property and getter for the description of the search that was just performed A getter that allows the JSP to select the correct template to render the event details The base class BaseSearchAction listing is shown next is the result of extracting the common elements. To ensure that developers subclass the action class correctly and all the elements necessary to render the results are provided the class is made abstract along with the getEventTemplate method. public abstract class BaseSearchAction extends BaseAction protected String userInfo protected List Event results protected EventService service public void setEventService .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.