What does the crossContext attribute do in Tomcat? Does it enable session sharing?

后端 未结 3 754
一个人的身影
一个人的身影 2020-11-30 06:42

All I can find in the Tomcat 5.5 docs is:

Set to true if you want calls within this application to ServletContext.getContext() to successfully return

3条回答
  •  情深已故
    2020-11-30 07:47

    From the javadoc ServletContext.getContext():

    This method allows servlets to gain access to the context for various parts of the server, and as needed obtain RequestDispatcher objects from the context. The given path must be begin with "/", is interpreted relative to the server's document root and is matched against the context roots of other web applications hosted on this container.

    So for instance if you want to include a page from a different webapp you need to set crossContext to true.

提交回复
热议问题