<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-1202757035268984281.post6400758980166544081..comments</id><updated>2009-06-08T18:48:18.167-07:00</updated><title type='text'>Comments on Enterprise Java - Digital Ascent: GWT-RPC with Spring 2.x</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.digitalascent.com/feeds/6400758980166544081/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1202757035268984281/6400758980166544081/comments/default'/><link rel='alternate' type='text/html' href='http://blog.digitalascent.com/2007/11/gwt-rpc-with-spring-2x_12.html'/><author><name>Chris Lee</name><uri>http://www.blogger.com/profile/04859052132907031955</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>9</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1202757035268984281.post-2368148504774626154</id><published>2008-04-22T08:21:00.000-07:00</published><updated>2008-04-22T08:21:00.000-07:00</updated><title type='text'>Interestingly, I came up with a similar solution w...</title><content type='html'>Interestingly, I came up with a similar solution while experimenting with GWT and Spring. I think the cleanest way to integrate Spring and GWT is indeed by using a Handler and HandlerAdapter pair...&lt;BR/&gt;I posted my solution @ http://forum.springframework.org/showthread.php?t=52805&lt;BR/&gt;Also, it seems GWT is going to pull some of the functions out of RemoteServiceServlet. That should enable you to remove the dependency on RemoteServiceServlet in your HandlerAdapter.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1202757035268984281/6400758980166544081/comments/default/2368148504774626154'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1202757035268984281/6400758980166544081/comments/default/2368148504774626154'/><link rel='alternate' type='text/html' href='http://blog.digitalascent.com/2007/11/gwt-rpc-with-spring-2x_12.html?showComment=1208877660000#c2368148504774626154' title=''/><author><name>Wouter</name><uri>http://www.blogger.com/profile/02088496144912767663</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.digitalascent.com/2007/11/gwt-rpc-with-spring-2x_12.html' ref='tag:blogger.com,1999:blog-1202757035268984281.post-6400758980166544081' source='http://www.blogger.com/feeds/1202757035268984281/posts/default/6400758980166544081' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-1202757035268984281.post-2443413403345738735</id><published>2008-02-15T06:12:00.000-08:00</published><updated>2008-02-15T06:12:00.000-08:00</updated><title type='text'>Really like this implementation!I've been posting ...</title><content type='html'>Really like this implementation!&lt;BR/&gt;&lt;BR/&gt;I've been posting on my blog a Spring and GWT tutorial for basic beginning steps, further on your guide will prove very useful!&lt;BR/&gt;&lt;BR/&gt;RemoteServiceServlet...gone :)</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1202757035268984281/6400758980166544081/comments/default/2443413403345738735'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1202757035268984281/6400758980166544081/comments/default/2443413403345738735'/><link rel='alternate' type='text/html' href='http://blog.digitalascent.com/2007/11/gwt-rpc-with-spring-2x_12.html?showComment=1203084720000#c2443413403345738735' title=''/><author><name>eggsy84</name><uri>http://www.blogger.com/profile/14081110838099322815</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.digitalascent.com/2007/11/gwt-rpc-with-spring-2x_12.html' ref='tag:blogger.com,1999:blog-1202757035268984281.post-6400758980166544081' source='http://www.blogger.com/feeds/1202757035268984281/posts/default/6400758980166544081' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-1202757035268984281.post-8130015937379885855</id><published>2008-02-15T05:51:00.000-08:00</published><updated>2008-02-15T05:51:00.000-08:00</updated><title type='text'>Really nice work. All we need now is a good extens...</title><content type='html'>Really nice work. &lt;BR/&gt;All we need now is a good extension point for the web.xml that gets re-generated. &lt;BR/&gt;&lt;BR/&gt;I am adding my config into the tomcat/conf/web.xml - this one does not get re-generated (GWiT 1.4).&lt;BR/&gt;&lt;BR/&gt;How do you setup your projects?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1202757035268984281/6400758980166544081/comments/default/8130015937379885855'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1202757035268984281/6400758980166544081/comments/default/8130015937379885855'/><link rel='alternate' type='text/html' href='http://blog.digitalascent.com/2007/11/gwt-rpc-with-spring-2x_12.html?showComment=1203083460000#c8130015937379885855' title=''/><author><name>Papick G. Taboada</name><uri>http://adminsight.de/2008/02/14/non-invasive-gwt-and-spring-integration/</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.digitalascent.com/2007/11/gwt-rpc-with-spring-2x_12.html' ref='tag:blogger.com,1999:blog-1202757035268984281.post-6400758980166544081' source='http://www.blogger.com/feeds/1202757035268984281/posts/default/6400758980166544081' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-1202757035268984281.post-3003791879404585443</id><published>2007-11-29T06:59:42.031-08:00</published><updated>2007-11-29T06:59:42.031-08:00</updated><title type='text'>Hi Martin,Good catch - because we subclass the Rem...</title><content type='html'>Hi Martin,&lt;BR/&gt;&lt;BR/&gt;Good catch - because we subclass the RemoteServiceServlet but don't actually use it as a Servlet, it doesn't have a ServletContext.  The original code didn't need/use the ServletContext and never encountered this problem.&lt;BR/&gt;&lt;BR/&gt;An alternate solution would be to use ServletContextAware to inject the servlet context.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1202757035268984281/6400758980166544081/comments/default/3003791879404585443'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1202757035268984281/6400758980166544081/comments/default/3003791879404585443'/><link rel='alternate' type='text/html' href='http://blog.digitalascent.com/2007/11/gwt-rpc-with-spring-2x_12.html?showComment=1196348382031#c3003791879404585443' title=''/><author><name>Chris Lee</name><uri>http://www.blogger.com/profile/04859052132907031955</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10678463964843992969'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.digitalascent.com/2007/11/gwt-rpc-with-spring-2x_12.html' ref='tag:blogger.com,1999:blog-1202757035268984281.post-6400758980166544081' source='http://www.blogger.com/feeds/1202757035268984281/posts/default/6400758980166544081' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-1202757035268984281.post-3327908629924744905</id><published>2007-11-29T02:31:00.000-08:00</published><updated>2007-11-29T02:31:00.000-08:00</updated><title type='text'>I fixed my issue for 1.4.60, but if you have a bet...</title><content type='html'>I fixed my issue for 1.4.60, but if you have a better solution, please let me know.&lt;BR/&gt;&lt;BR/&gt;&lt;BR/&gt;package com.mwaysolutions.gofer2.gwt;&lt;BR/&gt;&lt;BR/&gt;import javax.servlet.ServletContext;&lt;BR/&gt;import javax.servlet.http.HttpServletRequest;&lt;BR/&gt;import javax.servlet.http.HttpServletResponse;&lt;BR/&gt;&lt;BR/&gt;import org.springframework.beans.BeansException;&lt;BR/&gt;import org.springframework.context.ApplicationContext;&lt;BR/&gt;import org.springframework.context.ApplicationContextAware;&lt;BR/&gt;import org.springframework.web.context.WebApplicationContext;&lt;BR/&gt;import org.springframework.web.servlet.HandlerAdapter;&lt;BR/&gt;import org.springframework.web.servlet.ModelAndView;&lt;BR/&gt;&lt;BR/&gt;import com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException;&lt;BR/&gt;import com.google.gwt.user.client.rpc.RemoteService;&lt;BR/&gt;import com.google.gwt.user.client.rpc.SerializationException;&lt;BR/&gt;import com.google.gwt.user.server.rpc.RPC;&lt;BR/&gt;import com.google.gwt.user.server.rpc.RPCRequest;&lt;BR/&gt;import com.google.gwt.user.server.rpc.RemoteServiceServlet;&lt;BR/&gt;&lt;BR/&gt;/**&lt;BR/&gt; * Spring HandlerAdapter to dispatch GWT-RPC requests. Relies on handlers&lt;BR/&gt; * registered by GwtAnnotationHandlerMapper&lt;BR/&gt; * &lt;BR/&gt; * @author Chris Lee, Martin Zdila&lt;BR/&gt; * &lt;BR/&gt; */&lt;BR/&gt;public class GwtRcpEndPointHandlerAdapter extends RemoteServiceServlet implements HandlerAdapter, ApplicationContextAware {&lt;BR/&gt;&lt;BR/&gt; private static ThreadLocal&lt; Object&gt; handlerHolder = new ThreadLocal&lt; Object&gt;();&lt;BR/&gt; private static final long serialVersionUID = -7421136737990135393L;&lt;BR/&gt; private ApplicationContext applicationContext;&lt;BR/&gt; &lt;BR/&gt;&lt;BR/&gt; @Override&lt;BR/&gt; public long getLastModified(final HttpServletRequest request, final Object handler) {&lt;BR/&gt;  return -1;&lt;BR/&gt; }&lt;BR/&gt;&lt;BR/&gt;&lt;BR/&gt; @Override&lt;BR/&gt; public ModelAndView handle(final HttpServletRequest request, final HttpServletResponse response, final Object handler) throws Exception {&lt;BR/&gt;  try {&lt;BR/&gt;   // store the handler for retrieval in processCall()&lt;BR/&gt;   handlerHolder.set(handler);&lt;BR/&gt;   doPost(request, response);&lt;BR/&gt;  } finally {&lt;BR/&gt;   // clear out thread local to avoid resource leak&lt;BR/&gt;   handlerHolder.set(null);&lt;BR/&gt;  }&lt;BR/&gt;&lt;BR/&gt;  return null;&lt;BR/&gt; }&lt;BR/&gt;&lt;BR/&gt; &lt;BR/&gt; protected Object getCurrentHandler() {&lt;BR/&gt;  return handlerHolder.get();&lt;BR/&gt; }&lt;BR/&gt;&lt;BR/&gt; &lt;BR/&gt; @Override&lt;BR/&gt; public boolean supports(final Object handler) {&lt;BR/&gt;  return handler instanceof RemoteService /*&amp;&amp; handler.getClass().isAnnotationPresent(GwtRpcEndPoint.class)*/;&lt;BR/&gt; }&lt;BR/&gt;&lt;BR/&gt; &lt;BR/&gt; @Override&lt;BR/&gt; public String processCall(final String payload) throws SerializationException {&lt;BR/&gt;  /*&lt;BR/&gt;   * The code below is borrowed from RemoteServiceServet.processCall, with&lt;BR/&gt;   * the following changes:&lt;BR/&gt;   * &lt;BR/&gt;   * 1) Changed object for decoding and invocation to be the handler&lt;BR/&gt;   * (versus the original 'this')&lt;BR/&gt;   */&lt;BR/&gt;&lt;BR/&gt;     try {&lt;BR/&gt;   final RPCRequest rpcRequest = RPC.decodeRequest(payload, getCurrentHandler().getClass() /* this.getClass() */, this);&lt;BR/&gt;   return RPC.invokeAndEncodeResponse(getCurrentHandler() /* this */, rpcRequest.getMethod(), rpcRequest.getParameters(), rpcRequest.getSerializationPolicy());&lt;BR/&gt;  } catch (final IncompatibleRemoteServiceException ex) {&lt;BR/&gt;   getServletContext().log("An IncompatibleRemoteServiceException was thrown while processing this call.", ex);&lt;BR/&gt;   return RPC.encodeResponseForFailure(null, ex);&lt;BR/&gt;  }&lt;BR/&gt; }&lt;BR/&gt;&lt;BR/&gt;&lt;BR/&gt; @Override&lt;BR/&gt; public ServletContext getServletContext() {&lt;BR/&gt;  return ((WebApplicationContext) applicationContext).getServletContext();&lt;BR/&gt; }&lt;BR/&gt; &lt;BR/&gt; &lt;BR/&gt; @Override&lt;BR/&gt; public void setApplicationContext(final ApplicationContext applicationContext) throws BeansException {&lt;BR/&gt;  this.applicationContext = applicationContext;&lt;BR/&gt; }&lt;BR/&gt; &lt;BR/&gt;}</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1202757035268984281/6400758980166544081/comments/default/3327908629924744905'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1202757035268984281/6400758980166544081/comments/default/3327908629924744905'/><link rel='alternate' type='text/html' href='http://blog.digitalascent.com/2007/11/gwt-rpc-with-spring-2x_12.html?showComment=1196332260000#c3327908629924744905' title=''/><author><name>Martin</name><uri>http://www.blogger.com/profile/06709773379819963791</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.digitalascent.com/2007/11/gwt-rpc-with-spring-2x_12.html' ref='tag:blogger.com,1999:blog-1202757035268984281.post-6400758980166544081' source='http://www.blogger.com/feeds/1202757035268984281/posts/default/6400758980166544081' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-1202757035268984281.post-8353945648143846591</id><published>2007-11-29T00:51:00.000-08:00</published><updated>2007-11-29T00:51:00.000-08:00</updated><title type='text'>hi chrisusing GWT 1.4.60 and Tomcat 6.0.13GwtRcpEn...</title><content type='html'>hi chris&lt;BR/&gt;&lt;BR/&gt;using GWT 1.4.60 and Tomcat 6.0.13&lt;BR/&gt;&lt;BR/&gt;GwtRcpEndPointHandlerAdapter.getServletContext() causes NullPointerException because servlet's config is never initialized. How come that you didn't meet the same problem?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1202757035268984281/6400758980166544081/comments/default/8353945648143846591'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1202757035268984281/6400758980166544081/comments/default/8353945648143846591'/><link rel='alternate' type='text/html' href='http://blog.digitalascent.com/2007/11/gwt-rpc-with-spring-2x_12.html?showComment=1196326260000#c8353945648143846591' title=''/><author><name>Martin</name><uri>http://www.blogger.com/profile/06709773379819963791</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.digitalascent.com/2007/11/gwt-rpc-with-spring-2x_12.html' ref='tag:blogger.com,1999:blog-1202757035268984281.post-6400758980166544081' source='http://www.blogger.com/feeds/1202757035268984281/posts/default/6400758980166544081' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-1202757035268984281.post-2935651312291310337</id><published>2007-11-14T11:23:00.000-08:00</published><updated>2007-11-14T11:23:00.000-08:00</updated><title type='text'>@Chris.  This is a pretty slick example of the new...</title><content type='html'>@Chris.  This is a pretty slick example of the new Spring 2.5 features.&lt;BR/&gt;&lt;BR/&gt;@Scott.  The Spring DispatcherServlet puts the request into a ThreadLocal accessible indirectly via the RequestContextHolder.getRequestAttributes()</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1202757035268984281/6400758980166544081/comments/default/2935651312291310337'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1202757035268984281/6400758980166544081/comments/default/2935651312291310337'/><link rel='alternate' type='text/html' href='http://blog.digitalascent.com/2007/11/gwt-rpc-with-spring-2x_12.html?showComment=1195068180000#c2935651312291310337' title=''/><author><name>Solomon</name><uri>http://www.blogger.com/profile/09846073811897244636</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.digitalascent.com/2007/11/gwt-rpc-with-spring-2x_12.html' ref='tag:blogger.com,1999:blog-1202757035268984281.post-6400758980166544081' source='http://www.blogger.com/feeds/1202757035268984281/posts/default/6400758980166544081' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-1202757035268984281.post-9202992840426720059</id><published>2007-11-14T07:55:31.153-08:00</published><updated>2007-11-14T07:55:31.153-08:00</updated><title type='text'>I haven't wired in direct access for the request o...</title><content type='html'>I haven't wired in direct access for the request or session objects yet - that will come shortly, either in the form of a static utility class or a GwtRequestAware interface.&lt;BR/&gt;&lt;BR/&gt;My preference is to inject Spring request or session scoped beans (http://static.springframework.org/spring/docs/2.5.x/reference/beans.html#beans-factory-scopes-other)</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1202757035268984281/6400758980166544081/comments/default/9202992840426720059'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1202757035268984281/6400758980166544081/comments/default/9202992840426720059'/><link rel='alternate' type='text/html' href='http://blog.digitalascent.com/2007/11/gwt-rpc-with-spring-2x_12.html?showComment=1195055731153#c9202992840426720059' title=''/><author><name>Chris Lee</name><uri>http://www.blogger.com/profile/04859052132907031955</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10678463964843992969'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.digitalascent.com/2007/11/gwt-rpc-with-spring-2x_12.html' ref='tag:blogger.com,1999:blog-1202757035268984281.post-6400758980166544081' source='http://www.blogger.com/feeds/1202757035268984281/posts/default/6400758980166544081' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-1202757035268984281.post-8994899726147683679</id><published>2007-11-14T05:24:00.000-08:00</published><updated>2007-11-14T05:24:00.000-08:00</updated><title type='text'>Looks interesting Chris. Is there any way to get a...</title><content type='html'>Looks interesting Chris. Is there any way to get access to the request or session objects when using this approach?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1202757035268984281/6400758980166544081/comments/default/8994899726147683679'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1202757035268984281/6400758980166544081/comments/default/8994899726147683679'/><link rel='alternate' type='text/html' href='http://blog.digitalascent.com/2007/11/gwt-rpc-with-spring-2x_12.html?showComment=1195046640000#c8994899726147683679' title=''/><author><name>Scott</name><uri>http://www.blogger.com/profile/13455978716819910682</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.digitalascent.com/2007/11/gwt-rpc-with-spring-2x_12.html' ref='tag:blogger.com,1999:blog-1202757035268984281.post-6400758980166544081' source='http://www.blogger.com/feeds/1202757035268984281/posts/default/6400758980166544081' type='text/html'/></entry></feed>