JSF Central - Articles & Books
JSF Central

 Articles & Books 
Articles & Books > Articles
Creating onPageLoad functionality for JavaServer Faces using Facelets
Posted: March 16, 2007Published: March 9, 2007
Publisher: Alyssar
JavaServer Faces comes with lots of predefined tags. Unfortunately there is no tag providing onPageLoad functionality. I found this a rather desirable functionality. In complex user interfaces, excuting one method on your backing bean in the Invoke Application phase is not enough and you need to execute a second (or third, fourth, etc.) method in the Render Response phase (when rendering the result page). The IBM JSF implementation provides such a tag. Unfortunately, all other implementations do not. If you are using Facelets however, there is a solution to the problem. This article will describe how to create a TagHandler class that can execute a method through an EL expression. There are three steps to this solution:
  1. Create a TagHandler;
  2. Add it to your taglib.xml file
  3. Use it in your page

RSS feed(all feeds)
RSS feed(Articles)

The Editor's Desk
Inside Facelets
In the Trenches

Site version 1.83  Report web site problems

Copyright (C) 2003-2015 Virtua, Inc. All Rights Reserved. Java, JavaServer Faces, and all Java-based marks are trademarks or registered trademarks of Oracle Corporation. in the United States and other countries. Virtua, Inc. is independent of Oracle Corporation. All other trademarks are the sole property of their respective owners.