Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

http://thread.gmane.org/gmane.comp.web.click.user/1034
http://article.gmane.org/gmane.comp.web.click.user/1034
Thanks J.F. Zarama.

Replace Spring with Guice.

MyModule.java

Code Block
import static com.google.inject.name.Names.named;
import com.google.inject.AbstractModule;
import com.google.inject.Scopes;
import com.ibatis.sqlmap.client.SqlMapClient;

public class MyModule extends AbstractModule {

	@Override
	protected void configure() {
		bind(MyDao.class).to(MyDaoImpl.class).in(Scopes.SINGLETON);
		bind(SqlMapClient.class).toProvider(SqlMapClientP.class).in(
				Scopes.SINGLETON);
		bindConstant().annotatedWith(named("ibatis.configXml"))
				.to("myapp/xml/SqlMapConfig.xml"); //from classpath
	}

}

...