ServletContext servletCtx = context.getServletContext();
for (Enumeration e = servletCtx.getAttributeNames(); e.hasMoreElements(); ) {
String attrName = (String) e.nextElement();
Object attrValue = servletCtx.getAttribute(attrName);
Attribute attr = new Attribute();
attr.setName(attrName);
attr.setValue(attrValue);
attr.setType(ClassUtils.getQualifiedName(attrValue.getClass()));
attrs.add(attr);
}
return attrs;
}