Hello,

There is no such thing as a 'GWT Session'.  There is only HttpSession
kept in the request.  The RemoteServiceServlet gives access to the
HttpServletRequest via a ThreadLocal member.

http://www.google.com/codesearch/p?hl=en#A1edwVHBClQ/user/src/com/google/gwt/user/server/rpc/RemoteServiceServlet.java&q=RemoteServiceServlet%20package:http://google-web-toolkit\.googlecode\.com

During request handling, the processCall method in
RemoteServiceServlet calls:

RPC.invokeAndEncodeResponse(this, rpcRequest.getMethod(),
          rpcRequest.getParameters(), rpcRequest.getSerializationPolicy
());

This passes a 'this' reference which is presumably your
RemoteServiceServlet subclass which (aforementioned) holds a thread
local copy of of the request/response.

Unless somehow Tomcat is using different threads for super/sub class
calls or is changing request/response instances at some point between
the RemoteServiceServlet doPost method and your subclass's RPC method
there should not be any problem.

Matt

On Jan 19, 9:47 am, bikkelbikkel <[email protected]> wrote:
> Good morning,
>
> I'm using GWT in a web application running on Tomcat 6. This is
> running fine for months.
>
> Today i was told to get the GWT application running in a Tomcat
> Cluster. Configuring Tomcat wasn't a problem, normal HttpSession are
> replicated between servers without problems when using normal
> HttpSessions in jsp/servlet pages.
>
> But Tomcat doesn't seem to duplicate GWT Sessions. My server code uses
> the following method for GWT Sessions:
> ===
> HttpSession session=this.getThreadLocalRequest().getSession();
> session.setAttribute("loggedin", true);
> ===
> And to check if someone is logged in:
> ===
> HttpSession ses=this.getThreadLocalRequest().getSession(false);
> if(ses.getAttribute("monitor_loggedin")!=null){
> //loggedin}
>
> ===
>
> I suspect that getThreadLocalRequest().getSession() is not compatible
> with the Tomcat Session Replication.
>
> Is there a way to get this working or is there another way to create
> GWT Sessions?
>
> Thanks!
--~--~---------~--~----~------------~-------~--~----~
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