-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I would like to access a service class I have defined and registered it in my beans.xml file.
However, I do not know how to retrieve my instance without forcing reading the XML file. I would just like to retrieve the application context instance and get my service bean. Is it possible?
I don't know the paradigm that you're using, but you can easily have your composers instantiated by Spring when needed and have them resolved by
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?> ... <window id="xxxx" ... apply="${myController}" .... > .... </window>
this will cause Spring to lookup a bean with id = "myController" in its context. If the bean is defined like this:
<bean id="myController" class="com.my.package.controllers.MyController" scope="prototype"> <property name="property1" ref="beanRef1" /> <property name="property2" ref="beanRef2" /> <property name="property2" ref="beanRef2" /> </bean>
Asked: 2010-11-16 20:30:25 +0800
Seen: 617 times
Last updated: Nov 17 '10