FileDocCategorySizeDatePackage
ContextObject.javaAPI DocExample892Fri May 23 16:05:00 BST 2003com.jspservletcookbook

ContextObject

public class ContextObject extends Object

Fields Summary
private Map
map
Constructors Summary
public ContextObject()


 map = Collections.synchronizedMap(new HashMap());
Methods Summary
public java.util.MapgetMap()


return map;

public java.lang.StringgetValues()


 StringBuffer buf = new StringBuffer("");
 Set set = map.keySet();  
  
  synchronized(map) {  
  
      Iterator i = set.iterator(); 
      while (i.hasNext())
          buf.append((String) i.next() + "<br>");
  }
  
  return buf.toString();
 
public voidput(java.lang.Object key, java.lang.Object value)


 if (key == null || value == null)
   throw new IllegalArgumentException("Invalid parameters passed to ContextObject.put");
   
  map.put(key,value);
public java.lang.StringtoString()


return getClass().getName() + "[ " + map+ " ]";