Meaningless Drivel is fun!*
The moose likes Servlets and the fly likes Servlet Context Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet Context" Watch "Servlet Context" New topic

Servlet Context

Gregory Bonk

Joined: Aug 14, 2002
Posts: 1
Why does the serlvet context appear to change when I access the same server with a different URL? If I refer to a server like I will have a different servlet context from http://localhost/index.jsp when they are clearly accessing the same machine. Session attributes are different.
Bruce Jin
Ranch Hand

Joined: Sep 20, 2001
Posts: 666
The same machine can have many application thus many ServletContext.
However I think both and localhost/index should belong the default application.
Can you give more details?

We love Java programming. It is contagious, very cool, and lot of fun. - Peter Coad, Java Design

Crazy Bikes created by m-Power
Mario Rendon

Joined: Jul 11, 2002
Posts: 24
Well i have had that problem before ..

the session context is based on the Server "the browser sees"
sine the session is saved on a cookie called jsessionid this cookie is set to act on the context of the Server name .

that's why the context in localhost and are different..

also if you try autentications ( that is also a cookie ) are based on the same schema

Maybe it could be possible; if needed, to pass along the session ID to have the same context.

Grettings .
I agree. Here's the link:
subject: Servlet Context
Similar Threads
Localhost leads to nowhere
Apache cant be seen on WAN
Is it possible, More than one tomcat running in the one system?
Servlet Context Virtual Sandbox
starting problem of tomcat