hi how to use phase listener in jsf

hi i have a scenariao were the data have to fetched form database before the page gets loaded . so i came abt phase listeners . so can anybody give some example for phase listener.....thanks
[211 byte] By [mnrnjn_ranjana] at [2007-11-27 4:17:38]
# 1
Rather use the constructor or initialization block of the backing bean. If you want to use phaselisteners anyway, refer to the Java EE tutorial how to use them.
BalusCa at 2007-7-12 9:24:18 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Hi thanks for u quick reply can same some tell me how to use " initialization block of the backing bean." . i have tried using constructor but not this . so plz give me some samplethanksMessage was edited by: mnrnjn_ranjan
mnrnjn_ranjana at 2007-7-12 9:24:18 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

This is just basic Java knowledge, but anyway ..public class SomeClass {

static {

// static initialization block, this is executed only once per runtime, before the first instantiation.

}

{

// Initialization block, this is executed before the constructor on every instantiation.

}

public SomeClass() {

// the constructor, this is executed on every instantiation.

}

}

BalusCa at 2007-7-12 9:24:18 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...