java - How can I bind a spring-injected dependency to a wicket page? -
how can bind particular dependency page, , have injected components on page?
i have set environment in wicket application, using (very small) wicket-ioc , wicket-spring libraries, can call injectorholder.getinjector().inject(component), in order inject component dependencies. of wicket components injected spring via icomponentinstantiationlistener, , part works (i use hibernate access).
i have serializable object (componentgraph) want store field on page. how can spring figure out page component on, , inject right componentgraph page when componentgraph field @springbean declared?
if point me in right direction, appreciate it. have solid grasp of wicket, spring still maze of unfamiliar concepts me, @ point. =)
this not sound job spring.
however, don't know scope of componentgraph, have make guesses.
a) if there 1 per user, store in custom session object.
b) if there 1 per page instance, make base page class such pages inherit. let have componentgraph
field getter , setter.
c) if there 1 per page class, keep map of type <class, componentgraph>
in helper bean (accessible through helper.getcomponentgraphforpagetype(this.getclass())
. (and should) injected via spring
Comments
Post a Comment