• Post Reply Bookmark Topic Watch Topic
  • New Topic

About sessions

 
zohreh talebi
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

i didn't understand this paragraph :

"The session is context-specific. Some Web containers enable us to override this using crossContext="true"within the context
definition of our web.xml"

please explain it for me,

thanks

Zohreh
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
crossContext will allow you to have a single session object across all contexts instead of one for each context (app) and the ServletContext will now be / instead of /yourApplication. That means you can access other contexts
 
zohreh talebi
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Jhon,

I am sorry , i don't underestand clearly.
Can you explain it more.

be sucssesful,

Zohreh
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by zohreh talebi:

"The session is context-specific. Some Web containers enable us to override this using crossContext="true"within the context
definition of our web.xml"


Where is that quote from?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by John Meyers:
crossContext will allow you to have a single session object across all contexts instead of one for each context (app) and the ServletContext will now be / instead of /yourApplication. That means you can access other contexts


I've never seen a container that shares sessions across contexts.

Tomcat has a crossContext attribute but that only allows access to other contexts from within the same container

Example: getServletContext("otherApp").
 
zohreh talebi
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Friends,

Please look at this link . I think it can help us.

http://forum.java.sun.com/thread.jspa?forumID=45&threadID=492484

Thanks for all of you

Zohreh
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, the context can be thought of as the war itself, and everything running in it. You deploy web applications as war files.

So, if you deploy two war files, the session associated with Servlets and JSPs in one war file, can't be shared with web components in the second war file.

Basically, a user's session is local to the war file that created it, although all of the web components in that war file can access it.

-Cameron McKenzie
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!