Application Server contains classes from com.ibm.servlet.personalization.userprofile packages that maintain persistent information about WEB site visitors and use this information to customize Web pages become much easier. The UserProfile class includes the full name of the visitor, the postal address and the e-mail address, the phone number, and other data members, and contains fields for storing the selected language, occupation, and user-defined group information. In addition, it contains generic information, shopping carts, and clipboard (a Java hash table). This makes it easy for you to merge other objects of your choice into the data and handle them as part of the UserProfile class. Because these objects persist on subsequent instances of the user profile file, they must be serializable. If a JDBC database is used, the object is stored in the database. Otherwise, the object is stored as a file. In application Server version 2.0, the UserProfile class uses the database connection Manager to maintain the JDBC connection.
You can use the user profile page to configure the UserProfile class, which is used to define and maintain information about WEB site visitors. The UserProfile class uses the Connection manager to maintain connections to the jdbc-subordinate database. The basic settings for user profile files are as follows.
- 1. Enable user profile files
(1) View the "Settings", "User profile Files" page.
(2) Click the "Enable" tab.
(3) In the "Do I use user profile?" field, click Yes.
(4) For the Class name field, you can use the default value of "Com.ibm.servlet.personalization.userprofile.UserProfile" or the extension that is created for the UserProfile class.
(5) Click the "Save" button.
- 2. Specify Database Information
(1) View the "Settings", "User profile Files" page.
(2) Click the Database tab.
(3) Specify the name of the database product (such as IBM DB2 DB2).
(4) Specify the JDBC driver for the database (for example, COM.ibm.db2.jdbc.app.DB2Driver). Note This includes driver. zip or. jar files (such as DB2 's Db2java.zip) in the Java classpath of application Server.
(5) Specify the database name of the user profile file to store the data. If the database does not exist, it will not be created. Therefore, you can specify the name of an existing database, or create a database with that name before using the user profile file. There is no need to create any tables in the database.
(6) Specifies the owner of the database, which is the identifier of the user who created the database.
(7) Specifies the name of the database table where the user profile data is saved. You do not need to create the table because the UserProfile class creates it at initialization time.
(8) Specifies the user identifier that is used to access the database and its tables.
(9) Specify the password associated with the user identifier.
(10) Click the "Save" button.
- 3. Configure Connection Management Properties
(1) View the "Settings", "User profile Files" page.
(2) Click the "Connection Management" tab.
(3) Specify the connection buffer pool to use.
(4) Specifies whether to wait and try the connection again after the time specified by the connection timeout is still unavailable
The same as in the Connection Management page).
(5) Click the "Save" button.
The only coupling between the UserProfile class and the rest of application Server is that the UserProfile class and the IBM session implementation (IBMSESSIONDATA) contain the same user name segment, This user name segment can be used to create a number of synergies between two classes. The user profile object holds information about the user and is associated with the user's HttpSession object through a unique user name. The value of the user name is set and returned by the Sessiondata class GetUserName () and the Setusername () method.
You can also extend the UserProfile class to create a subclass that is more appropriate for your business needs, and use the application Server Manager to specify a specialized userprofile subclass that can be used for all WEB applications.
websphere--User Summary table