Lightweight Web Application Framework: PrimeFaces (JSF) + Guice + MyBatis (PART 2)
In this part, I will continue to demonstrate the integration of JSF, Guice and MyBatis. DBCP connection pool and MYSQL database is used in persistence layer Integrate Google Guice with MyBatis In the previous post, we have created a ServletContextListener. Now, we just bind the BasicDataSourceProvider and JdbcTransactionFactory in the contextInitialized method. GuiceContextListener.java package org.borislam; import java.util.Properties; import javax.servlet.ServletContext; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; import org.apache.ibatis.transaction.jdbc.JdbcTransactionFactory; import org.apache.log4j.xml.DOMConfigurator; import org.borislam.mapper.StaffMapper; import org.borislam.service.SimpleService; import org.borislam.service.impl.SimpleServiceImpl; import org.mybatis.guice.MyBatisModule; import org.mybatis.guice.datasource.dbcp.BasicDataSourceProvider; import org.mybatis.guice.datasource.helper.JdbcHelper; import com.google....