if(WebConstants.Scope.REQUEST.equalsIgnoreCase(scopedKeys[0]))
{
if(scopedKeys.length > 1)
getRequest().setAttribute(scopedKeys[1], obj);
else
throw new ObjectSourceException("key "+SbmUtils.toString(key)+" is illegal, you can not replace "
+SbmUtils.toString(WebConstants.Scope.REQUEST)+" scope object");
}
else if(WebConstants.Scope.SESSION.equalsIgnoreCase(scopedKeys[0]))
{
if(scopedKeys.length > 1)
getRequest().getSession().setAttribute(scopedKeys[1], obj);
else
throw new ObjectSourceException("key "+SbmUtils.toString(key)+" is illegal, you can not replace "
+SbmUtils.toString(WebConstants.Scope.SESSION)+" scope object");
}
else if(WebConstants.Scope.APPLICATION.equalsIgnoreCase(scopedKeys[0]))
{
if(scopedKeys.length > 1)
getApplication().setAttribute(scopedKeys[1], obj);
else
throw new ObjectSourceException("key "+SbmUtils.toString(key)+" is illegal, you can not replace "
+SbmUtils.toString(WebConstants.Scope.APPLICATION)+" scope object");
}
else if(WebConstants.Scope.PARAM.equalsIgnoreCase(scopedKeys[0]))
{
throw new ObjectSourceException("key "+SbmUtils.toString(key)+" is illegal, set object to "
+SbmUtils.toString(WebConstants.Scope.PARAM)+" scope is not supported");
}
else if(WebConstants.Scope.RESPONSE.equalsIgnoreCase(scopedKeys[0]))
{
throw new ObjectSourceException("key "+SbmUtils.toString(key)+" is illegal, set object to "
+SbmUtils.toString(WebConstants.Scope.RESPONSE)+" scope is not supported");
}
else if(WebConstants.Scope.OBJECT_SOURCE.equalsIgnoreCase(scopedKeys[0]))
{
throw new ObjectSourceException("key "+SbmUtils.toString(key)+" is illegal, set object to "
+SbmUtils.toString(WebConstants.Scope.OBJECT_SOURCE)+" scope is not supported");
}
else
setObjectWithScopeUnknownKey(strKey, obj);