tailieunhanh - Expert Spring MVC and Web Flow phần 5

trong trường hợp này, là một điều tốt. Các lớp giao diện người dùng là chịu trách nhiệm làm các byte được gửi cho khách hàng. Khách hàng, trong một ứng dụng web, là từ xa và kết nối thông qua một không đáng tin cậy Việc chuyển giao | CHAPTER 6 THE CONTROLLER MENAGERIE 151 This controller has a complex work flow and we will break it down into its core components. Then we will show you the best extension points for altering the work flow in the controller. We begin by illustrating all possible paths through the controller. Figure 6-1 illustrates the many paths through the work flow of handling forms with SimpleFormController. Done Figure 6-1. SimpleFormController activity diagram We will focus on the initial retrieval of the HTML form first. The controller uses the method isFormSubmission to determine if the HTTP request is either a form viewing or form submission. The default implementation of this method merely checks the HTTP method and if it is a POST then isFormSubmission returns true. The controller does not consider a HTTP GET request a form submission. However this method is not final so your implementation is free to define whatever criteria is appropriate to indicate the request should be treated as a submission. If indeed the request is not a form submission the 152 CHAPTER 6 THE CONTROLLER MENAGERIE controller will then consider this request as the first of two requests the second being the actual form submission . It will create an instance of the form object . command bean using the formBackingObject method. By default this method will return an instance of the class specified with setCommandClass . The formBackingObject method is not final so you will use this method to configure if necessary the form object class possibly setting any dependencies or properties. This is the time to manipulate the form object before it enters the work flow. Once the instance of the form object is ready the controller then creates the DataBinder and calls the initBinder life cycle method. Override this method to register any custom PropertyEditors required when binding to the form object. By default this method does nothing. Now that the DataBinder instance is ready you have the choice of .

TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
crossorigin="anonymous">
Đã 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.