Example usage for javax.security.jacc PolicyContextException toString

List of usage examples for javax.security.jacc PolicyContextException toString

Introduction

In this page you can find the example usage for javax.security.jacc PolicyContextException toString.

Prototype

public String toString() 

Source Link

Document

Returns a short description of this throwable.

Usage

From source file:adalid.jaas.google.GoogleRecaptcha.java

private static String getRequestParameter(String key) {
    if (key == null) {
        return null;
    }// w w  w .  j  a  v a  2s  .c  om
    Object request;
    try {
        request = PolicyContext.getContext(HttpServletRequest.class.getName());
    } catch (PolicyContextException ex) {
        logger.log(Level.SEVERE, ex.toString(), ex);
        return null;
    }
    if (request instanceof HttpServletRequest) {
        HttpServletRequest httpServletRequest = (HttpServletRequest) request;
        String parameter = httpServletRequest.getParameter(key);
        logger.log(TRACE, "{0}: {1}", new Object[] { key, parameter });
        return parameter;
    }
    logger.log(TRACE, "HTTP Servlet Request: {0}", request);
    return null;
}