News: Microservlet now "talking" with Spring IOC 3.1.1

15 views
Skip to first unread message

Helio Frota

unread,
Mar 20, 2012, 9:53:54 PM3/20/12
to ajaxp...@googlegroups.com
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
Reply all
Reply to author
Forward
0 new messages