public class SpringComponentInjector extends Injector implements IComponentInstantiationListener, IBehaviorInstantiationListener
IComponentInstantiationListener that injects component and behavior properties
annotated with SpringBean annotations.
To install in yourapplication.init() call
getComponentInstantiationListeners().add(new SpringComponentInjector(this));
Only Wicket Components and Behaviors are automatically injected, other classes
such as Session, Model, and any other POJO can be injected by calling
Injector.get().inject(this) in their constructor.
| Constructor and Description |
|---|
SpringComponentInjector(WebApplication webapp)
Constructor used when spring application context is declared in the spring standard way and
can be located through
WebApplicationContextUtils.getRequiredWebApplicationContext(ServletContext) |
SpringComponentInjector(WebApplication webapp,
org.springframework.context.ApplicationContext ctx)
Constructor
|
SpringComponentInjector(WebApplication webapp,
org.springframework.context.ApplicationContext ctx,
boolean wrapInProxies)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
inject(Object object) |
void |
onInstantiation(Behavior behavior) |
void |
onInstantiation(Component component) |
public SpringComponentInjector(WebApplication webapp)
WebApplicationContextUtils.getRequiredWebApplicationContext(ServletContext)webapp - wicket web applicationpublic SpringComponentInjector(WebApplication webapp, org.springframework.context.ApplicationContext ctx)
webapp - wicket web applicationctx - spring's application contextpublic SpringComponentInjector(WebApplication webapp, org.springframework.context.ApplicationContext ctx, boolean wrapInProxies)
webapp - wicket web applicationctx - spring's application contextwrapInProxies - whether or not wicket should wrap dependencies with specialized proxies that can
be safely serialized. in most cases this should be set to true.public void onInstantiation(Component component)
onInstantiation in interface IComponentInstantiationListenerpublic void onInstantiation(Behavior behavior)
onInstantiation in interface IBehaviorInstantiationListenerCopyright © 2006-2012 Apache Software Foundation. All Rights Reserved.