when a componentTreein apostbacksafter the request is restored, each of the componentsRequestTo get their own values in the parameters, which are usedProcessdecodesmethod. This value is stored locally in each component, and the code for this procedure is simpler in the source because the implementation will encapsulate the value of the operation in the Processdecodes method. But honestly, the implementation of this part of JSF is very unsuccessful because there are nearly 2000 lines of code in Uiviewroot , which, this, this ...
(Processdecodes method in Uiviewroot.java)
public void Processdecodes (Facescontext context) { initstate (); Notifybefore (context, phaseid.apply_request_values); try { if (!skipphase) { if (Context.getpartialviewcontext (). Ispartialrequest () && ! Context.getpartialviewcontext (). Isexecuteall ()) { context.getpartialviewcontext (). Processpartial ( phaseid.apply_request_values); } else { super.processdecodes (context); } Broadcastevents (context, phaseid.apply_request_values); } } finally { clearfacesevents (context); Notifyafter (context, phaseid.apply_request_values); } }
If any one of the decoding methods or events of the listener invokes the Renderresponse method in the current Facescontext instance. The creator of the JSF skips the Render Response step. In fact, it's good to understand that when you're dealing with a component's desired value, the page is rendered directly to the user if an error is encountered. But the author in the JSF source code has not found this part of the implementation (decay ~)
If any of the events are added to the queue in this step, JSF will pass this event to the relevant listener.
If the immediate property in some components on the page is set to true then the validation, conversions, and event bindings will all be done in this step, and if any conversion fails this component will produce an error message. And put this information in the facescontext display queue. This information will be displayed in the Render Response step, as does the validation error message in the validation step.
If the program needs to redirect to a different application resource or to produce a response, and the response does not contain any JSF components, call the Facescontext.responsecomplete method directly.
The final component of this step will be given a new value, and the message and time will be placed in the queue for processing.
If the current request is defined as a partial request, the local content is recovered from the facescontext and the local processing method is executed.
Each of the above paragraphs is said to deal with different situations at this stage, or all the situations that should be considered in the Processdecodes method, Apply Request values phase Word: take the value!