Ryan,

> Is there anyway to create JSessionIDs per window rather than per
> browser?  I am having the problem of when you open multiple tabs within
> a browser, and enter two simultaneous queries, the results returned are
> corrupted.  Any suggestions?  Thanks for the help.

I have an application that allows the user to perform searches and
paginate through the results. Since the search really only needs to be
performed once, pagination can be as simple as picking a segment of the
results (stored in the session) and displayed on the screen.

I store the query that was performed as well as a "token" which is
generated when the query is created. I place this token in all of the
URLs on the page (most importantly, the ones involved with pagination).
If a request comes into the server including a token, I check the token
against what I have in the session. If the tokens match, I skip the
search. If they do not match, I re-run the search and re-set the token.
Rinse, repeat.

In your case, you might want multiple simultaneous paginating queries,
though I'm not exactly sure why. You could adopt a similar approach
using a List of queries (using the same session key, I would imagine),
each with separate tokens for the windows.

The only problem with an implementation like this is that it is very
hard to decide when you are "finished" with a query, and that it's okay
to purge it from the session. That is left as an exercise for the reader ;)

Hope that helps,
-chris


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to