Skip to main content

Posts

Featured

Phase Event listener in JSF and create table if not exist in database

Phase Event  Phase events are processed in between each phase of the JSF request processing life cycle. Therefore, these can be used to check or report the sequence of processing of different phases of JSF life cycle. HERE IS THE EXAMPLE regPhaseListener.java --------------------------------------------------------------------------------------- package EventHandlers; import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.logging.Level; import java.util.logging.Logger; import javax.annotation.Resource; import javax.faces.event.PhaseEvent; import javax.faces.event.PhaseId; import javax.faces.event.PhaseListener; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import javax.sql.DataSource; public class regPhaseListener implements PhaseListener{       // Resource injection using ins...

Latest posts