Tuesday, March 26, 2024

jsf.zeef.com is down

No panic. I've restored the lists below =)

JSF phases/lifecycle cheatsheet

  • fc = FacesContext
  • vh = ViewHandler
  • in = UIInput
  • rq = HttpServletRequest
  • id = in.getClientId(fc);
1 RESTORE_VIEW

String viewId = rq.getServletPath(); fc.setViewRoot(vh.createView(fc, viewId));

2 APPLY_REQUEST_VALUES

in.setSubmittedValue(rq.getParameter(id));

3 PROCESS_VALIDATIONS

Object value = in.getSubmittedValue();
try {
  value = in.getConvertedValue(fc, value);
  for (Validator v : in.getValidators())
    v.validate(fc, in, value);
  }
  in.setSubmittedValue(null);
  in.setValue(value);
} catch (ConverterException
    | ValidatorException e) {
  fc.addMessage(id, e.getFacesMessage());
  fc.validationFailed(); // Skips 4+5.
  in.setValid(false);
}

4 UPDATE_MODEL_VALUES

bean.setProperty(in.getValue());

5 INVOKE_APPLICATION

bean.submit();

6 RENDER_RESPONSE

vh.renderView(fc, fc.getViewRoot());