[gwt-contrib] RequestFactoryServlet

2011-05-23 Thread Jeff Larsen
@Bobv

One thing about RequestFactoryServlet is that it is somewhat difficult to 
setup DI from containers such as Spring. I've been working on getting Spring 
wired into the request factory framework and there are a bunch of examples, 
but they all are pretty ugly. I think I've found a fairly clean solution, 
and it only involves a minimal change to RequestFactoryServlet to 
accomplish.

If we added ServletContext to a ThreadLocal, the same way we add HttpRequest 
and HttpResponse, then it becomes trivial to get the servlet context out of 
the request factory.

Then creating your Spring locator can look like : 

public class SpringServiceLocator implements ServiceLocator {

public Object getInstance(Class? arg0) {

ApplicationContext ctx = 
WebApplicationContextUtils.getWebApplicationContext(SpringRequestFactoryServlet.getThreadLocalServletContext().get());
return ctx.getBean(arg0);
}

}

and with Spring 3, everything should roll together nicely (I'm in the middle 
of working this out, but this should work). 

I'm will implement this for my project. My question is, Does it makes sense 
to add the ServletContext into RequestFactoryServlet inside GWT proper? If 
so, I can submit a patch for you. 

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Re: [gwt-contrib] RequestFactoryServlet

2011-05-23 Thread BobV
 Does it makes sense
 to add the ServletContext into RequestFactoryServlet inside GWT proper? If
 so, I can submit a patch for you.

That sounds like a very clean approach.  When you submit the patch,
please create an issue in the GWT issue tracker with the URL of the
code review.

-- 
Bob Vawter
Google Web Toolkit Team

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors


Re: [gwt-contrib] RequestFactoryServlet

2011-05-23 Thread Jeff Larsen
Created the issue as well and posted a link to the review. 

Thanks!

http://gwt-code-reviews.appspot.com/1448804/


http://code.google.com/p/google-web-toolkit/issues/list?cursor=6393updated=6393ts=1306206518

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Re: [gwt-contrib] RequestFactoryServlet

2011-05-23 Thread Jeff Larsen
Oh and I did test this to make sure it would with Spring. If you're 
interested here is a link to my test project. 

https://github.com/larsenje/SpringRequestFactoryExample

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

[gwt-contrib] RequestFactoryServlet and Record are a bit limiting

2010-07-22 Thread Yazan
RequestFactoryServlet assumes static methods and data binding is
available to Record that represents an entity (id and version) which
is not always the case, isn't this a bit limiting it seems to be only
tailored to be used with ROO. Some people will still want to use
controller/service classes and bind to normal beans.

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors


Re: [gwt-contrib] RequestFactoryServlet and Record are a bit limiting

2010-07-22 Thread Ray Ryan
Please read the design wave to see our plan to fix this.

https://wave.google.com/wave/waveref/googlewave.com/w+WU4iAICkI

On Thu, Jul 22, 2010 at 1:57 AM, Yazan qet...@gmail.com wrote:

 RequestFactoryServlet assumes static methods and data binding is
 available to Record that represents an entity (id and version) which
 is not always the case, isn't this a bit limiting it seems to be only
 tailored to be used with ROO. Some people will still want to use
 controller/service classes and bind to normal beans.

 --
 http://groups.google.com/group/Google-Web-Toolkit-Contributors


-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors