You can run multiple ATG applications in the form of WAR files within a single EAR. In this case, you should share session-scoped Nucleus components so that your application will always have access to the same instance of session scoped components. By default, J2EE servers hand out different session objects in each web application visited, even if all requests came from the same browser. Sharing sessions across ATG applications ensures that you can build a J2EE application consisting of multiple WAR files in a single EAR, and each WAR has access to the same session-scoped components. Note that you should never run more than a single ATG EAR per application server instance.

When multiple web applications exist in the ATG EAR file, one of them must be designated as the parent application. Being the parent means that that application’s session ID is used as the basis for creating the ATG session scope root.

By default, ATG makes the <ATG10dir>\DafEar\base\j2ee-components\atg_bootstrap.war file the parent web application. The parent context path is /dyn. No additional configuration is required to use this, but your web applications should define the atg.session.parentContextName and atg.dafear.bootstrapContextName parameters in their web.xml to point to the parent web-application as shown:

<context-param>
   <param-name>atg.session.parentContextName</param-name>
   <param-value>/dyn</param-value>
</context-param>
<context-param>
   <param-name>atg.dafear.bootstrapContextName</param-name>
   <param-value>/dyn</param-value>
   <description>The name of the DAF bootstrap WAR context.</description>
</context-param>

The context path the context-param points to must be for a WAR file with the SessionNameContextServlet defined in its web.xml:

<servlet>
   <servlet-name>SessionNameContextServlet</servlet-name>
   <servlet-class>atg.nucleus.servlet.SessionNameContextServlet
   </servlet-class>
</servlet>

Note that there can be only one parent web application specified per EAR file. Therefore, if you change the parent application, be sure to set the context-param to the same values in all web.xml files within your EAR file:

<context-param>
   <param-name>atg.session.parentContextName</param-name>
   <param-value>/portal</param-value>
</context-param>

Note: This information applies only to session-scoped Nucleus components, and does not affect HTTP sessions obtained using atg.servlet.ServletUtil.getDynamoRequest(request).getSession(), which retain a context particular to the current web application.


Copyright © 1997, 2012 Oracle and/or its affiliates. All rights reserved.

Legal Notices