Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
1 reply Latest Post - ‏2012-04-27T20:08:09Z by R.Goff
SouthAustin
SouthAustin
1 Post
ACCEPTED ANSWER

Pinned topic Are these Tomcat 6 config options available in Liberty ?

‏2012-04-27T18:42:28Z |
Looking to migrate some legacy Tomcat 6 (Servlet 2.4) apps to Liberty.

Is there the equivalent of these 2 attributes on Tomcat's Context element in Liberty ?

1) crossContext - Set to true if you want calls within this application to ServletContext.getContext()
to successfully return a request dispatcher for other web applications running on this virtual host.
Set to false (the default) in security conscious environments, to make getContext() always return null.

Note: In my apps this is used to assemble a page with portions from 2 webapps. Any setting in Liberty
that would allow me to get a RequestDispatcher of another webapp would suffice

2) sessionCookiePath - The path to be used for all session cookies created for this Context. If not set,
the context path will be used. Note that this will be overridden by the emptySessionPath attribute on
the connector used to access this Context.

Note: In my apps this is used to share session state between webapps.So
I'm setting it as follows sessionCookiePath="/". So anything that would allow session sharing between webapps
in Liberty would suffice.
  • R.Goff
    R.Goff
    6 Posts
    ACCEPTED ANSWER

    Re: Are these Tomcat 6 config options available in Liberty ?

    ‏2012-04-27T20:08:09Z  in response to SouthAustin
    1. By default, you should be able to call ServletContext.getContext(path) and then get a RequestDispatcher from that context. In a secure environment, we will enforce security on these types of dispatches, so the user must be authenticated if security is required by the application.

    2. Using the same path for the session cookie does not mean that you are using the same session object. IBM has supported the IBM extension "Shared Session Context" in the ibm-application-ext.xml which will share a session object between web modules within an application. This is still supported in Liberty. You need to specify sharedSessionContext="true" in the ibm-application-ext.xml.