jsf 2 - JSF - Another question on Lifecycle -
today i'd know features on jsf lifecycle. let me start :
1 - phase 2:apply request values - during phase,each component in view search values in request , set new values them
uhm, ok nice. so, view built due previous beans parameters. after, there partial view, generated request values. (right? later, in 3° phase, compared) . but, example, if values in request list absent during creation of last view? values null?
2 - phase 5: invoke application - once values of request has been set backing bean action events queued during apply request values phase processed. in our case submit buttons action method .
this not clear @ all. @ moment have (on beans) values updated previous phase (if validation , apply request aren't failed). ok, happens? means the action events queued during apply request values phase processed? means that, example, if action submit process finished? that's why ajax call, if not rendered in 2° phase, fail? or fails?
3 - phase 6: render response - in phase component tree rendered client.
it means view on server updated using updated bean values? and, after this, html code created view? or made html code , save view status?
hope can me :)
phase 2:apply request values - during phase,each component in view search values in request , set new values them
uhm, ok nice. so, view built due previous beans parameters. after, there partial view, generated request values. (right? later, in 3° phase, compared) . but, example, if values in request list absent during creation of last view? values null?
basically following happening under covers (here, input
uiinput
, request
httpservletrequest
):
if (input.isrendered()) { string value = request.getparameter(input.getclientid()); if (value != null) { input.setsubmittedvalue(value); } }
so, untouched if there's no request parameter. won't set null
, kept default.
phase 5: invoke application - once values of request has been set backing bean action events queued during apply request values phase processed. in our case submit buttons action method .
this not clear @ all. @ moment have (on beans) values updated previous phase (if validation , apply request aren't failed). ok, happens? means action events queued during apply request values phase processed? means that, example, if action submit process finished? that's why ajax call, if not rendered in 2° phase, fail? or fails?
during 2nd phase basically following happen (here, command
uicommand
, request
httpservletrequest
, actionevent
actionevent
):
if (command.isrendered()) { string value = request.getparameter(command.getclientid()); if (value != null) { command.queueevent(new actionevent(command)); // queue invoke_action. } }
then, during invoke application phase, events queued particular phase invoked.
phase 6: render response - in phase component tree rendered client.
it means view on server updated using updated bean values? and, after this, html code created view? or made html code , save view status?
during phase jsf walks through component tree , components encoded (will invoke renderer
of components, default html renderer). during encoding, values obtained model. view won't updated. basically:
facescontext.getviewroot().encodeall();
Comments
Post a Comment