Why and when to perform this task
Properties can be retrieved from a work area by using the get method. This method is intentionally lightweight; there are no declared exceptions to handle. If there is no active work area, or if there is no such property set in the current work area, the get method returns null.
Example
The following example shows the retrieval of the site-identifier and priority properties by the SimpleSampleBean. Recall that one property was set into an outer work area by the client, and the other property was set into the nested work area by the server-side bean; the nesting is transparent to the retrieval of the properties.
public class SimpleSampleBeanImpl implements SessionBean { public String [] test() { ... // Begin a nested work area. userWorkArea.begin("SimpleSampleBean"); try { userWorkArea.set("company", SimpleSampleCompany.London_Development); } catch (NotOriginator e) { } SimpleSampleCompany company = (SimpleSampleCompany) userWorkArea.get("company"); SimpleSamplePriority priority = (SimpleSamplePriority) userWorkArea.get("priority"); ... } }
Related concepts
Work area property modes
Nested work areas