Returns true only if a valid scope value is specified:
page, request, session or application.
boolean isValid = false;
String scope = data.getAttributeString("scope");
if (scope == null || scope.equals("page") || scope.equals("request") ||
scope.equals("session") || scope.equals("application")) {
isValid = true;
}
return isValid;