In
http://java.sun.com/javaee/javaserverfaces/2.0/docs/pdldocs/facelets/f/event.html is also stated, that the event attribute is named "name" and not "type".
The term "one-time executed code" is ambiguous and depends on the context where the code should be executed:
If you want to execute code before rendering a particular page I would call this pattern "page controller". In this case the above mentioned approach should be fine.
If you want to execute code before rendering any page, a servlet filter or phase listener should do it's work.
If you want to execute code to initialize the state of something stateful (like a controller e.g.), which does not depends on external parameters like request params or on which page the controller is used, an initalizer method sound quite fine to me.
[Message sent by forum member 'tzwoenn']
http://forums.java.net/jive/thread.jspa?messageID=392561