ok = false;
}
}
// Retrieve and validate the shared session bean
SharedSessionBean ssb = null;
if (ok) {
Object object = session.getAttribute("sharedSessionBean");
if (object == null) {
writer.println("Session03 FAILED - Cannot retrieve ssb");
ok = false;
} else if (!(object instanceof SharedSessionBean)) {
writer.println("Session03 FAILED - Shared attribute class "
+ object.getClass().getName());
ok = false;
} else {
ssb = (SharedSessionBean) object;
String value = ssb.getStringProperty();
if (!"Session01".equals(value)) {
writer.println("Session03 FAILED - Shared property ="
+ value);
ok = false;
} else {
session.removeAttribute("sharedSessionBean");
String lifecycle = ssb.getLifecycle();
if (!"/vb/swp/sda/vu".equals(lifecycle)) {
writer.println("Session03 FAILED - Shared lifecycle ="
+ lifecycle);
ok = false;
}
}
}
}
// Retrieve and validate the unpacked shared session bean
UnpSharedSessionBean ussb = null;
if (ok) {
Object object = session.getAttribute("unpSharedSessionBean");
if (object == null) {
writer.println("Session03 FAILED - Cannot retrieve ussb");
ok = false;
} else if (!(object instanceof UnpSharedSessionBean)) {
writer.println("Session03 FAILED - unpShared attribute class "
+ object.getClass().getName());
ok = false;
} else {
ussb = (UnpSharedSessionBean) object;
String value = ussb.getStringProperty();
if (!"Session01".equals(value)) {
writer.println("Session03 FAILED - unpShared property ="
+ value);
ok = false;
} else {
session.removeAttribute("unpSharedSessionBean");
String lifecycle = ssb.getLifecycle();
if (!"/vb/swp/sda/vu".equals(lifecycle)) {
writer.println("Session03 FAILED - unpShared lifecycle ="
+ lifecycle);
ok = false;
}