My understanding of JSF is still shallow.
I am reading the document and as per javadoc of FacesContext
there is the RenderResponse and ResponseComplete that allows you to short-circuit the lifecycle.
I am currently confused.. when do you use the one over the other in real situation?
Thanks
Use FacesContext#renderResponse()
if you want to move forward to the render response phase right now. You see this often in combination with value change listener hacks which run in validations phase and should skip the update model values and invoke action phases.
Use FacesContext#responseComplete()
to signal JSF that you've already handled the response yourself and that JSF thus doesn't need to render the response. You see this often in combination with backing bean action methods which write a file download to the response. This will ensure that JSF don't append the file download with the content of the rendered HTML which may end up in corrupted download or an illegal state exception.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With