public ServletRequest resolveServletRequest() {

        ServletRequest request = getServletRequest();

        //fall back on existing subject instance if it exists:
        if (request == null) {
            Subject existing = getSubject();
            if (existing instanceof WebSubject) {
                request = ((WebSubject) existing).getServletRequest();
            }
        }

        return request;
    }
Default {@code WebSubjectContext} implementation that provides for additional storage and retrieval of
a {@link ServletRequest} and {@link ServletResponse}.

@since 1.0
web/src/main/java/org/apache/shiro/web/subject/support/DefaultWebSubjectContext.java