Get a request parameter stripped of white space. Return default for null
or zero length.

@param name    name of parameter
@param def default value
@return  String   value
338295
public String getReqPar(final String name, final String def) {
    final String s = Util.checkNull(request.getParameter(name));

    if (s != null) {
      return s;
    }

    return def;
  }
1023135
public static function getGetParameter(string $name, string $default = null, array $allowed = null): string
    {
        return self::get('GET', $name, $default, $allowed);
    }
1294789
public static String get(String name, String def) {
        String val = null;
        final String fname = name;
        if (System.getSecurityManager() != null) {
            try {
                val = AccessController.doPrivileged(new PrivilegedAction<String>() {
                    @Override
                    public String run() {
                        return System.getProperty(fname);
                    }
                });
            } catch (AccessControlException e) {
                // ignore
                // TODO log this message
            }
        } else {
            val = System.getProperty(name);
        }

        if (val == null) {
            val = CONFIG_PROPS.getProperty(name, def);
        }
        return val;
    }
1182174
public long getLongReqPar(final String name,
                            final long defaultVal) throws Throwable {
    String reqpar = getReqPar(name);

    if (reqpar == null) {
      return defaultVal;
    }

    try {
      return Long.parseLong(reqpar);
    } catch (Throwable t) {
      return defaultVal; // XXX exception?
    }
  }
1251921
public static Long getLongParameter(final HttpServletRequest request, final String name) {
		String value = request.getParameter(name);
		if (StringUtils.isBlank(value)) {
			return null;
		}
		return Long.valueOf(value);
	}
1288145
protected final <T> T __getRenderPropertyAs(String name, T def) {
        Object o = __getRenderProperty(name, def);
        return null == o ? def : (T) o;
    }
753066
public int getIntReqPar(final String name,
                          final int defaultVal) throws Throwable {
    String reqpar = getReqPar(name);

    if (reqpar == null) {
      return defaultVal;
    }

    try {
      return Integer.parseInt(reqpar);
    } catch (Throwable t) {
      return defaultVal; // XXX exception?
    }
  }
414517
public String getResponseHeaderValue(String name, String defaultVal) {
        if (m_response.containsHeader(name)) {
            return m_response.getFirstHeader(name).getValue();
        } else {
            return defaultVal;
        }
    }
1032572
public String getParameterAsString(String name, String defaultValue) {
		return defaultValue(blankToNull(getParameter(name)), defaultValue);
	}
485651
public function input($name=null, $default=null)
    {
        if (!$name) {
            return $this->getRequestParams();
        } else {
            $method = $name2 = null;
            $name = str_replace('.', ':', $name);
            if (($pos = strpos($name, ':')) !== false) {
                $names = explode(':', $name);
                $method = strtoupper(trim($names[0]));
                if (in_array($method, ['GET', 'POST', 'OPTION', 'DELETE', 'PUT'])) {
                    $name = trim($names[1]);
                    if (isset($names[2])) {
                        $name2 = trim($names[2]);
                    }
                } else {
                    $method = null;
                    $name = trim($names[0]);
                    $name2 = trim($names[1]);
                }
            } elseif (strtoupper($name) == 'GET' || strtoupper($name) == 'POST') {
                $method = strtoupper($name);
                $name = null;
            }
            
            if ($name === '*') {
                $name = null;
            }
            
            switch ($method) {
                case 'GET':
                    if ($name2) {
                        return isset($this->getQueryParam()[$name][$name2]) ? $this->getQueryParam()[$name][$name2] : $default;
                    } else {
                        return $name ? $this->getQueryParam($name, $default) : $this->getQueryParams();
                    }
                    break;
                case 'POST':
                    if ($name2) {
                        return isset($this->getPostParams()[$name][$name2]) ? $this->getPostParams()[$name][$name2] : $default;
                    } else {
                        return $name ? (isset($this->getPostParams()[$name]) ? $this->getPostParams()[$name] : $default) : $this->getPostParams();
                    }
                    break;
                default:
                    if ($name2) {
                        return isset($this->getRequestParams()[$name][$name2]) ? $this->getRequestParams()[$name][$name2] : $default;
                    } else {
                        return $name ? (isset($this->getRequestParams()[$name]) ? $this->getRequestParams()[$name] : $default) : $this->getRequestParams();
                    }
                    break;
            }
        }
    }
524027
public String getParameter(String name) {

        String[] p = getParameterMap().get(name);
        if (p != null) {
            return p[0];
        }

        return null;
    }
648400
protected String getValue (String name, Object defaultValue)
    {
        String value = getParameter(name);
        if (StringUtil.isBlank(value)) {
            if (defaultValue == null) {
                value = "";
            } else {
                value = String.valueOf(defaultValue);
            }
        }
        return HTMLUtil.entify(value);
    }
769166
public String single(final CharSequence name, final String def)
        throws IOException {
        final String value;
        final Iterator<String> params = this.param(name).iterator();
        if (params.hasNext()) {
            value = params.next();
        } else {
            value = def;
        }
        return value;
    }
977958
public static function requestString($name, $default = null)
    {
        if (isset($_REQUEST[$name]) && $_REQUEST[$name] !== '') return self::parseInputToString($_REQUEST[$name]);
        return $default;
    }
245908
public static function getDeleteParameter(string $name, $default = null, array $allowed = null): string
    {
        return self::get('DELETE', $name, $default, $allowed);
    }
114803
public String getRequestParam(HttpServletRequest request, String param, String defaultValue)
    {
        String value = request.getParameter(servicePid + '.' + param);
        if ((value == null) && (properties != null))
            value = properties.get(servicePid + '.' + param);
        if (value == null)
            value = request.getParameter(param);
        if ((value == null) && (properties != null))
            value = properties.get(param);
        if (value == null)
                value = defaultValue;
        return value;
    }
991356
private Optional<HttpSessionToken> getDefaultToken(String name) {
		return defaultTokens.stream().filter(e -> name.equalsIgnoreCase(e.getName())).findFirst();
	}