public static boolean getBooleanAttribute(HttpServletRequest request, String name) {
        String temp = (String)request.getAttribute(name);
        if (temp != null && temp.equals("true")) {
            return true;
        }
        else {
            return false;
        }
    }
Returns an attribute as a boolean.

@param request the HttpServletRequest object, known as "request" in a JSP page.
@param name the name of the attribute you want to get.
@return true if the value of the attribute is "true", false otherwise.
xmppserver/src/main/java/org/jivesoftware/util/ParamUtils.java