Set Web module ActivitySession deployment attributes
Overview
Use this task to set the ActivitySession deployment attributes for a Web application to start UserActivitySessions and perform work scoped within ActivitySessions.
One can configure the deployment attributes of an application by using an assembly tool such as the Application Server Toolkit (AST) or Rational Web Developer.
This topic describes the use of the Application Server Toolkit (AST) to configure the deployment attributes. This task description assumes that you have an EAR file, which contains an application enterprise bean that can be deployed in WebSphere Application Server.
To set the ActivitySession deployment attributes for a Web application, complete the following steps:
Procedure
- Start the assembly tool.
- Create or edit the Web module. For example, to change attributes of an existing module, click...
File | Open | archive file...for the module. For example, to change attributes of an existing module, use the import wizard to import the EAR or WAR file into the assembly tool. To start the import wizard...
File | Import | WAR file | Next | WAR file. | Finish- In the J2EE Hierarchy view,...
Web module | Open With | Deployment Descriptor EditorA property dialog notebook for the Web module is displayed in the property pane.
- In the property pane, select the Extended services tab.
- Select the servlet that you want to change.
- In the ActivitySession section, set the ActivitySession control kind attribute to either Application, Container, or None.
- Application
- The Web application is responsible for starting and ending ActivitySessions, as follows:
- If an HttpSession is active when an application begins an ActivitySession, then the container associates the ActivitySession with the HttpSession.
- If an ActivitySession is started in the absence of an HttpSession, then the application must ensure it is completed before the dispatched method completes; otherwise, an exception results.
- If an HttpSession is associated with a request dispatched to an application with this ActivitySession control value, and if that HttpSession has an ActivitySession associated with it, then the container dispatches the request in the context of that ActivitySession. For example, the container resumes the ActivitySession context onto the thread before the dispatch.
- A Web application can use both transactions and ActivitySessions. Any transactions started within the scope of an ActivitySession must be ended by the web component that started them and within the same request dispatch.
- Container
- A servlet has no access to UserActivitySessions. Any HttpSession started by the servlet has an ActivitySession automatically associated with it by the container, and this ActivitySession is put onto the thread of execution. If such a servlet is dispatched by a request that has an HttpSession containing no ActivitySession, then the container starts an ActivitySession and associates it with the HttpSession and the thread.
A Web application can use both transactions and ActivitySessions. Any transactions started within the scope of an ActivitySession must be ended by the web component that started them and within the same request dispatch.
- None
- A servlet has no access to UserActivitySession. An HttpSession started by the servlet does not have an ActivitySession automatically associated with it by the container. If such a servlet is dispatched by a request that has an HttpSession containing an ActivitySession, then the container dispatches the request in the context of that ActivitySession. For example, the container resumes the ActivitySession context onto the thread before the dispatch.
- To apply the changes and close the assembly tool, click OK. Otherwise, to apply the values but keep the property dialog open for additional edits, click Apply.
- Save your changes to the deployment descriptor.
- Close the deployment descriptor editor.
- When prompted, click Yes to indicate that you want to save changes to the deployment descriptor.
- Verify the archive files.
- From the popup menu of the project, click Deploy to generate EJB deployment code.
- Optional: Test your completed module on a WAS installation. Right-click a module, click Run on Server, and follow the instructions in the displayed wizard. Note that Run on Server works on the Windows, Linux/Intel, and AIX operating systems only; one cannot deploy remotely from the Application Server Toolkit (AST) or Rational Web Developer to a WAS installation on a UNIX operating system such as Solaris. Important
Note: Use Run On Server for unit testing only. The Application Server Toolkit (AST) or Rational Web Developer controls the WAS installation and, when an application is published remotely, the assembly tool overwrites the server configuration file for that server. Do not use on production servers.
What to do next
After assembling your application, use a systems management tool to deploy the WAR file; for example, using the administrative console as described in Deploying and managing applications.
See Also
The ActivitySession service