Tuesday, August 2, 2011

Re: GWT and Spring

Si estas interesante en usando RequestFactory, es facil usar Spring con RequestFactory en 2.4-RC.

Hacer un class se llama SpringServiceLocator

public class SpringServiceLocator implements ServiceLocator {

    public Object getInstance(Class<?> arg0) {
        ApplicationContext ctx = WebApplicationContextUtils
                .getWebApplicationContext(RequestFactoryServlet.getThreadLocalServletContext());
        return ctx.getBean(arg0);
    }
}

y usarlos en totas sus RequestContext annotations

@Service(value=MyService.class, locator=SpringServiceLocator.class)
public interface MyRequestContext extends RequestContext{
     ....
}

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/Wm3sEjfoAxMJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment