Accessing the UserWorkArea partition
关于此任务
The work area service provides a JNDI binding to an implementation of the UserWorkArea interface under the name java:comp/websphere/UserWorkArea. This is the default work area partition, namly the "UserWorkArea" partition. It is created and bound into JNDI naming automatically, as long as it is enabled as defined in Enabling the work area service (UserWorkArea partition). Applications that need to access UserWorkArea partition can perform a lookup on that JNDI name, as shown in the following code example:
示例
import com.ibm.websphere.workarea.*;
import javax.naming.*;
public class SimpleSampleServlet {
...
InitialContext jndi = null;
UserWorkArea userWorkArea = null;
try {
jndi = new InitialContext();
userWorkArea = (UserWorkArea)jndi.lookup(
"java:comp/websphere/UserWorkArea");
}
catch (NamingException e) { ... }
}
用户可以选择使用工作区分区服务来创建自己的工作区分区,而不是使用这个缺省工作区分区。