public function getParam($name, $defaultValue=null, $useDefaultIfEmpty=false){
        if (!isset($this->params[$name])) {
            return $defaultValue;
        }
        // we cannot use the empty() function because 0 returns true. And maybe we want 0
        // as a normal value...
        if (is_scalar($this->params[$name])) {
            if ($useDefaultIfEmpty && trim($this->params[$name]) == '' ) {
                return $defaultValue;
            }
            else {
                return $this->params[$name];
            }
        }
        else{
            // array or object
            if ( $useDefaultIfEmpty && empty($this->params[$name]) ) {
                return $defaultValue;
            }
            else {
                return $this->params[$name];
            }
        }
    }