if (session != null) {
bean = session.getAttribute(name);
}
}
if (bean == null) {
Context context = ObjectModelHelper.getContext(objectModel);
if (context != null) {
bean = context.getAttribute(name);
}
}
if (bean == null) {
bean = objectModel.get(name);
}
} else if (SCOPE_SITEMAP.equals(scope)) {
bean = objectModel.get(name);
} else if (SCOPE_REQUEST.equals(scope)) {
bean = request.getAttribute(name);
} if (SCOPE_SESSION.equals(scope)) {
Session session = request.getSession(false);
if (session != null) {
bean = session.getAttribute(name);
}
} if (SCOPE_CONTEXT.equals(scope)) {
Context context = ObjectModelHelper.getContext(objectModel);
if(context != null){
bean=context.getAttribute(name);
}
}
if (bean != null) {
insertBean(name, bean, mapping);