我们看一下变量seldevices:
  Hashtable seldevices = new Hashtable();  ---> 正确
  Vector getsel = new Vector(); 
  try 
  { 
    seldevices = (Hashtable)session.getAttribute("totsel"); --》如果totsel不存在 , seldevices = null 而不会抛出 NullPointerException
    getsel = (Vector)seldevices.get(seltype); 
    getsel.trimToSize(); 
  } 
  catch(NullPointerException e) 
  {} 
  catch(Exception e) 
  {} 
  getsel.add(device); 
  getsel.trimToSize(); 
  seldevices.put(seltype,getsel);  --》seldevices == null !!!!!
   这里一定会跳出NullPointerException。
  session.setAttribute("totsel",seldevices);