Need to store a session-specific string for use in other threads

21 views
Skip to first unread message

Drew Fitting

unread,
Aug 11, 2011, 11:19:59 AM8/11/11
to Google Web Toolkit
Hey All,

First off, I am new to gwt, so I hope I phrase everything right.

Our team has a gwt application that needs to access a custom, (string)
token that comes in the http header from our perimiter authentication
device; I have already solved this problem with a (non-gwt, regular)
servlet welcome page, which extracts the header item then writes the
same html as the original, static html page, which then runs the gwt
app just fine, as it did before.

But my real problem now is how to store that token in some kind of
(session-specific) variable so that it can be accessed by other
threads when they make web service calls; I have successfully
inserted handler(s) into my outgoing SOAP web service calls, but my
dilemma is how to get the correct token that the servlet got from the
http header... Again, I need the one from This Session.

So, can anyone suggest a way to store and retreive a session-specific
string token, on the server side, which can be accessed by any of the
threads from the pool?

Thanks in advance, and

Take Care,
Drew

Jens

unread,
Aug 11, 2011, 12:01:05 PM8/11/11
to google-we...@googlegroups.com
Can't you save it in the http session? In your custom servlet that extracts the http header value you already have a session where you can store the header value. Now when your GWT app makes server requests you should have the same session in your GWT servlets. Retrieve the header value from the session and start your outgoing SOAP web service call. Or am I missing something?

-- J.

Drew Fitting

unread,
Aug 11, 2011, 6:01:40 PM8/11/11
to Google Web Toolkit
Hey Jens,

Thanks for the quick reply; Your idea sounds great, and I'm sure I
can figure out how to store it in that session (at the Welcome
servlet)... How, then, would I get that http session (with the
contained token) back while in a SOAP handler?

Thanks, and

Take Care,
Drew
Reply all
Reply to author
Forward
0 new messages