ECLIPSE WEB TOOLS PLATFORM developing java web applications PHẦN 3

Bộ điều khiển đầu vào là một tính năng trung tâm. Có một bộ điều khiển đầu vào duy nhất cho tất cả các trang trong một ứng dụng Web. Bộ điều khiển đầu vào phân tích đầu vào, xác định các cơ chế tham số đi qua, chất chiết xuất từ bất kỳ thông tin cần thiết từ yêu cầu, hợp tác với bộ điều khiển ứng dụng để xác định các hoạt động tiếp theo (thường được gọi là một hành động), và gọi hành động trong bối cảnh chính xác. . | 124 CHAPTER 5 Web Application Architecture and Design In the following sections we discuss the basic object structure of Web MVC frameworks see Figure . This architecture is implemented by many of the previously mentioned frameworks. Figure MVC for the Web Input Controller The input controller is a central feature. There is a single input controller for all pages in a Web application. The input controller parses input determines the parameter-passing mechanisms extracts any necessary information from the request cooperates with the application controller to determine the next operation typically called an action and invokes that action in the correct context. By having a single component as an input controller any knowledge of HTTP or naming conventions is localized at the request level. This reduces the amount of code duplication and the total size of code. This also makes it easier to modify any of the input processing functions because there is a single point of modification. Note that the input controller component is typically a servlet and there may be one instance for accessing the applications over HTTP via a regular Web browser and another instance for mobile applications using a Wireless Application Protocol WAP enabled device. Web Applications 125 Application Controller The application controller is typically a regular Java object. It coordinates logic related to the application flow handles errors maintains longer-term state including references to the business objects and determines which view to display. The application controller needs to understand requests and how they participate in the organized flow of the application and forward these requests to the planned responses. Web requests are HTTP encoded string and string-based key-value pairs. Application controllers typically need a mapping of these input keys to the application objects that manage the flow. Most frameworks maintain these mappings in complex XML configuration files such as

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
Đã 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.