This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes context in server.xml and sessions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "context in server.xml and sessions" Watch "context in server.xml and sessions" New topic

context in server.xml and sessions

Joel Carklin

Joined: Jun 15, 2001
Posts: 28
Hi everyone,
I'm confused about sessions and contexts and ssl
for the following reason:
I have 3 web apps: sharedWebApp, customerWebApp and
administratorWebApp (for example).
The sharedWebApp is used by both customers and administrators, it contains no secured pages.
Both the customer and admin webapps require login and pages are served over ssl.
In my server.xml, I define 3 contexts,
the sharedApp is the 'default context' defined as follows:
<Context path="" docBase="/path/sharedApp/web"/>
<Context path="/customer" docBase="/path/customerApp/web"/>
<Context path="/administrator" docBase="/path/administratorApp/web"/>
Now, this is the confusing part:
When I start tomcat and go directly to
http://localhost:8080/customer I go to customerApp index.jsp, on ssl as expected. index is a login page,
I can log in, browse about and everything is cool.
When I start tomcat and go to http://localhost:8080 I go to the sharedApp index.jsp as expected. this index page has a link,
<a href="/customer"> which goes to the customerApp index page as expected (after checking certificates etc) I can login to the customerApp as normal, but when I try browse around I get 'thrown out'. This is because a session attribute I set upon successful login, is no longer there when I try to go to another page??? It's like there is another session started or something
Sorry for being long winded,. not sure how to explain exactly whats happening.
Anyway, thanks for any comments
Hope this is the right group to post to...
I agree. Here's the link:
subject: context in server.xml and sessions
Similar Threads
HTTP Status 404 -- Apache Tomcat/4.1.18
Can't inlculde files from a parent directory in new tomcat
How to package a project and install in tomcat webapps?
Tomcat 4 : How to deploy and run JSP and Servlets
setting default context in Tomcat