public static String getParameter(HttpServletRequest request, String name,
            boolean emptyStringsOK)
    {
        String temp = request.getParameter(name);
        if (temp != null) {
            if (temp.isEmpty() && !emptyStringsOK) {
                return null;
            }
            else {
                return temp;
            }
        }
        else {
            return null;
        }
    }
Returns a parameter as a string.

@param request the HttpServletRequest object, known as "request" in a
     JSP page.
@param name the name of the parameter you want to get
@param emptyStringsOK return the parameter values even if it is an empty string.
@return the value of the parameter or null if the parameter was not
     found.
xmppserver/src/main/java/org/jivesoftware/util/ParamUtils.java