Hello fellows !
The Microservlet project now talks with Spring IOC 3.1.1 !
Here some code from the sample that can be downloaded
here.
The Spring annotation configuration class (
dispensing boring XML configuration) :
@Configuration
public class SpringAnnotationConfiguration {
@Bean()
@Scope(value = "request")
public HelloForm helloForm() {
return new HelloForm();
}
}
Here the basic example getting the instance managed by IOC container:
protected HelloForm getRequestFormWithSpring() {
ApplicationContext applicationContext = WebApplicationContextUtils.getRequiredWebApplicationContext(getServletContext());
HelloForm helloForm = (HelloForm) applicationContext.getBean(HelloForm.class);
return helloForm;
}
Best regards,
Ajax Portal team