How does that work? I am doing the above code in a servlet filter so there is no GWT code above the filter. All the GWT code is in the RemoteServlet and ServletFilters run before the RemoteServlet code does. I also want to throw a GwtSessionTimeoutException so I can pass a url for the gwt clients to redirect to the correct location. I have many GWT apps that will use this filter. thanks, Dean
On Dec 18, 7:06 am, "Arthur Kalmenson" <[email protected]> wrote: > Hi Dean, > > Are you trying to encode an exception to throw it back to the client > side? AFAIK, you can just throw a IsSerializable exception in your > code and GWT-RPC will transfer the said exception to the client side > for you. > > -- > Arthur Kalmenson > > On Thu, Dec 18, 2008 at 12:55 AM, deanhiller <[email protected]> wrote: > > > I have the following code in a servlet filter.... > > > GwtSessionTimeout timeout = new GwtSessionTimeout( > > "Session timed out. You need to redirect to > > the url in getUrl > > function", > > url); > > try { > > String payload = > > RPCServletUtils.readContentAsUtf8(request, true); > > RPCRequest rpcRequest = RPC.decodeRequest(payload); > > payload = RPC.encodeResponseForFailure(null, > > timeout); > > > boolean gzipEncode = > > RPCServletUtils.acceptsGzipEncoding(request) > > && shouldCompressResponse(request, > > response, payload); > > > ServletContext servletContext = request.getSession > > ().getServletContext(); > > RPCServletUtils.writeResponse(servletContext, > > response, payload, > > gzipEncode); > > > } catch (SerializationException e) { > > throw new RuntimeException("Exception", e); > > } catch (ServletException e) { > > throw new RuntimeException("Exception",e); > > } > > > The browser(firefox) says "This application is out of date, please > > click the refresh button on your browser." > > > If I change > > payload = RPC.encodeResponseForFailure(null, timeout); > > to > > payload = RPC.encodeResponseForFailure(rpcRequest.getMethod, timeout); > > > it fails with UnexpectedException like GwtSessionTimeout was not a > > RuntimeException, but it is a RuntimeException so it should work and I > > expect the aysncCallback.onFailure to be called, but it doesn't work. > > > Here is my GwtSessionTimeout.... > > public class GwtSessionTimeout extends RuntimeException implements > > IsSerializable{ > > } > > > why isn't this working? > > later, > > Dean --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
