my dog learned polymorphism
The moose likes Tomcat and the fly likes Which tomact request is routed to ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Which tomact request is routed to ?" Watch "Which tomact request is routed to ?" New topic

Which tomact request is routed to ?

Kiran Kumar Chitturi

Joined: Jan 28, 2007
Posts: 4
Hi, As a part of session stickness I need to know which tomcat the request is routed to. Is there any way I can know that ?

I have a tomcat running with two clusters.

or is there any other way I can test the session stickiness
Anirvan Majumdar
Ranch Hand

Joined: Feb 22, 2005
Posts: 261
For only testing purpose, you can write a filter in your web app which would have a static final variable [string/int]. This variable can have a different value depending upon the server on which the web app is deployed. Map this filter to the url-pattern "/" and keep printing the variable to the console for every request.

Thereafter, keep requesting your server cluster. To test stickiness, bring down a server which has active sessions. If you keep requesting from the same session, then the console should indicate that a different server is catering to the request while at the client side the session doesn't appear to be destroyed.
[ September 30, 2008: Message edited by: Anirvan Majumdar ]
I agree. Here's the link:
subject: Which tomact request is routed to ?
jQuery in Action, 3rd edition