Showing posts with label Postbacks. Show all posts
Showing posts with label Postbacks. Show all posts

Wednesday, March 25, 2009

Quick Note about JSF, ADF and Postbacks

Unlike ADF, in pure JSF it appears there is no AdfFacesContext.postback context element to use to determine if you are currently in a post back or not. To determine postback you have to do some odd stuff.

So what is a postback? In short it is when a JSF page submits and it stays right where it is. In other words the action of the form is set to post to itself, passing all of its named fields as parameters. When the Faces Servlet sees this occurring it alters its “behavior”. The normal JSF request lifecycle has 7 or 8 phases when it is drawn out for others to see…but all these phases only come into play on a post back. When you first call a JSF page, all that you actually get is the first and the last phase…everything else is left out.

These postbacks are extremely important in the Rich Component world though. You have to postback in order to implement a very nice way to do AJAX functionality without having to make others who want to use your components add servlets to their web.xml.