Wicketが従う "Javaでdo-it-all-in-Java"という考え方が好きなら、GuiceをSpringより優先したいかもしれません。 GuiceにはXML設定はありません。Guice Module
クラスを使用してすべて実行されます。
たとえば、あなたのウィケットWebApplication
クラスは次のようになります。
public class SampleApplication extends WebApplication
{
@Override
protected void init()
{
addComponentInstantiationListener(
new GuiceComponentInjector(this, new GuiceModule()));
}
}
GuiceComponentInjector
は改札-Guiceの拡張子から来ています。ここでは、モジュールの:この例では
public class GuiceModule extends AbstractModule
{
@Override
protected void configure()
{
// Business object bindings go here.
bind(Greetings.class).to(GreetingRepository.class);
}
}
、Greetings
コンクリートGreetingRepository
クラスによって実装されるインタフェースです。 GuiceがGreetings
オブジェクトを注入する必要がある場合、GreetingRepository
の依存関係を満たします。
私は、Google App EngineのWicket/Guiceアプリケーションを構築する方法を示すsample projectをまとめました。 App Engineの仕様を無視して、Wicket-Guiceの統合の仕組みに焦点を当てることができます。
あなたはSpringでもすべてのJavaを実行することができます... – tetsuo