So, I added code to my ServletFilter(I didn't feel like getting
involved in spring at all and wanted to move it up from the GWT
servlet to use for all calls), but I could not get the code to
work.....

http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/8444004a667f11fe#

I think there is just a simple mistake...anyone know?
thanks,
Dean

On Nov 1, 10:46 pm, medgey <[email protected]> wrote:
> I think you can do session variable checking before processCall.  For
> example, you could do so in a servlet filter and send
> encodeResponseForFailure if the session is not setup properly.  There
> is no need to override processCall for this purpose.
>
> Now, for checks on particular parameters (etc) that require
> decodeRequest - overriding processCall is a good bet.
>
> On Oct 3, 12:05 pm, falafala <[email protected]> wrote:
>
> > If go for non-spring solution, yes, you should override the
> > processCall().
> > Just take a look at the source, you should invoke the
> > RPC.encodeResponseForFailure(method, ex)
> > to encode the Exception and send back to client.
>
> > I didnt test. It may not compile, you may try anyway ... :)
>
> > public String processCall(String payload) throws
> > SerializationException {
> >     try {
> >       RPCRequest rpcRequest = RPC.decodeRequest(payload,
> > this.getClass(), this);
>
> >       if (isValidSession())   // may add other conditions when should
> > check, when should not check..
> >       {
> >           return RPC.invokeAndEncodeResponse(this,
> > rpcRequest.getMethod(),
> >               rpcRequest.getParameters(),
> > rpcRequest.getSerializationPolicy());
> >       }
> >       else
> >       {
> >          return RPC.encodeResponseForFailure(rpcRequest.getMethod(),
> > new NotLoggedInException());
> >       }
>
> >     } catch (IncompatibleRemoteServiceException ex) {
> >       getServletContext().log(
> >           "An IncompatibleRemoteServiceException was thrown while
> > processing this call.",
> >           ex);
> >       return RPC.encodeResponseForFailure(null, ex);
> >     }
> >   }
>
> > private boolean isValidSession(....)
> > {
> >     //...
>
> > }
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to