tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wagoner, Mark" <>
Subject RE: Session Tracking throughout apps
Date Fri, 18 Jan 2002 21:09:30 GMT
Unfortunately, I think the answer to your question is "it depends".

You could code the controller servlet to handle all of the requests, in
which case you would want to make it as small and fast as possible.
Possibly get the session info, request a login if there is no session (if
that is a requirement) determine the next servlet and pass on the request.

You can also have different servlets for each of your request types (message
board, etc.) and, as long as they are all in the same context, they will
have access to the same session information.  The mappings for these would
go in the application's web.xml file rather than the server.xml file.  There
would be one context entry in server.xml which contains all of the different
servlet mappings.

If your apps are really totally unrelated other than sharing session info,
the multiple servlet mappings may be the most flexible.  If there is a good
deal of processing that has to be performed with each request regardless of
the target servlet (such as getting a JDBC connection) then the single
controller is probably better.

-----Original Message-----
From: Charles N. Harvey III []
Sent: Friday, January 18, 2002 2:47 PM
To: Tomcat Users List
Subject: Session Tracking throughout apps

Hello list.
I'm not sure if this is a tomcat question or a java (servlet) question
so try not to get too angry if this is on the wrong board.

I am setting up my environment to use a controller servlet that
brokers all the requests that come in for the site.  About 80% of my
site are pages that will be served up this way, through the controller.
But the other 20% are seperate applications - message boards, photo
uploads, contests with registration.

What I am slightly confused about is, should the requests for these
apps also go through the controller servlet?  And if so I don't know
how yet - but I will find out.  If not (which is my current level of
knowledge) then each one gets its own mapping in server.xml and its
own directory structure.  If this is the case, how do I maintain session
across the rest of the site and these side apps?  I am pretty new to
java hence my confusion.  Can I just pass the session object from one
to the other?  Is there something special I have to implement?

Any help would be greatly appreciated.  And if this post is in the wrong
place just say so and I will find the appropriate java list to post to.


Charlie Harvey

To unsubscribe:   <>
For additional commands: <>
Troubles with the list: <>

To unsubscribe:   <>
For additional commands: <>
Troubles with the list: <>

View raw message