public static SavedRequest getSavedRequest(ServletRequest request) {
        SavedRequest savedRequest = null;
        Subject subject = SecurityUtils.getSubject();
        Session session = subject.getSession(false);
        if (session != null) {
            savedRequest = (SavedRequest) session.getAttribute(SAVED_REQUEST_KEY);
        }
        return savedRequest;
    }
Convenience method that returns a request parameter value, first running it through
{@link StringUtils#clean(String)}.

@param request   the servlet request.
@param paramName the parameter name.
@return the clean param value, or null if the param does not exist or is empty.
web/src/main/java/org/apache/shiro/web/util/WebUtils.java